PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → Windev 21 - Capitalizar Texto
Windev 21 - Capitalizar Texto
Débuté par Mister ANDRE MARTINI, 24 oct. 2016 18:20 - Aucune réponse
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 24 octobre 2016 - 18:20
Procedure CapitalizaTexto(sTexto is string)
sTexto = Lower(NoAccent(sTexto))//tudo minusculo
i is int
bEspacoAnterior is boolean = True
FOR i = 1 TO Length(sTexto)
IF bEspacoAnterior THEN
//coloca em maíusculo a letra
sTexto = Middle(sTexto,1,i-1) + Upper(Middle(sTexto,i,1)) + Middle(sTexto,i+1)
bEspacoAnterior = False
END
IF Asc(Middle(sTexto,i,1)) = 32 THEN //se for espaço
bEspacoAnterior = True
END
END
RESULT sTexto




--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html