Preciso de uma simples função
Como faço para Receber uma string e tirar todos os acentos dela...
Valeu!!
[]´s Ricardo
ricardo@dgpram.com.br
Valeu!!
[]´s Ricardo
ricardo@dgpram.com.br
Shikota
Curtidas 0
Respostas
Lucas Silva
05/02/2004
Esse assunto já rolou aqui no fórum.
Tenta pesquisar sobre ele ai....
Tenta pesquisar sobre ele ai....
GOSTEI 0
Imoreira
05/02/2004
Function TiraAcento(Str: String): String; function strtran(Str: String; Antigo: String; Novo: variant): string; var Buffer : string; x : integer; begin Buffer := ´´; for x := 1 to length(Str) do begin if copy(Str,x,1) = Antigo then begin Buffer := Buffer + Novo; end else begin Buffer := Buffer + copy(Str,x,1); end; end; Result := Buffer; end; begin Str := Strtran(Str,´Ã´,´A´); Str := Strtran(Str,´Õ´,´O´); Str := Strtran(Str,´Á´,´A´); Str := Strtran(Str,´É´,´E´); Str := Strtran(Str,´Í´,´I´); Str := Strtran(Str,´Ó´,´O´); Str := Strtran(Str,´Ú´,´U´); Str := Strtran(Str,´À´,´A´); Str := Strtran(Str,´È´,´E´); Str := Strtran(Str,´Ì´,´I´); Str := Strtran(Str,´Ò´,´O´); Str := Strtran(Str,´Ù´,´U´); Str := Strtran(Str,´Ê´,´E´); Str := Strtran(Str,´Ô´,´O´); Str := Strtran(Str,´Ç´,´C´); Result := Str; end;
Use-a assim:
label1.caption:=TiraAcento(edit1.text);
GOSTEI 0