segunda-feira, 25 de fevereiro de 2008

É sem acento!!! Em VB.Net

Taí uma função pra tirar acentuação de Strings...

Public Function TiraAcento(ByVal sTexto As String) As String
Dim sComAcento As String = "ÄÅÁÂÀÃäáâàãÉÊËÈéêëèÍÎÏÌíîïìÖÓÔÒÕöóôòõÜÚÛüúûùÇç"
Dim sSemAcento As String = "AAAAAAaaaaaEEEEeeeeIIIIiiiiOOOOOoooooUUUuuuuCc"
Dim i As Integer
For i = 1 To sComAcento.Length
sTexto = sTexto.Replace(Mid(sComAcento, i, 1).ToString(), Mid(sSemAcento, i, 1).ToString())
Next
Return sTexto
End Function

2 comentários:

Anônimo disse...

19/8/2008 15:32 --->
To sem cerebro pra escrever esta função então acabei de pegar a sua!!!

Rs...Valew...

Teuvo Vehkalahti disse...

This blog is through a nice to meet new people and their land, culture and nature. Come and look at you Teuvo Kuvat - Teuvo images, both at the same time will be my blog collection flag depicting your country's flag to rise higher. You should also tell all your friends to my blog by fermentation. Teuvo Vehkalahti Finland