PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Capitalize First Letter In Each Word
Capitalize First Letter In Each Word
Iniciado por Glenn Rathke, mar., 28 2006 4:31 PM - 5 respostas
Publicado em março, 28 2006 - 4:31 PM
Is there a control or a setting that Will Capitalize The First Letter In Each Word. If not, the following code works well using a space as a delimeter.
Edit1..Value = " " + Edit1..Value
X is int
OldChar is string
NewChar is string
FOR X = 97 TO 122
OldChar = " " + Charact(X)
NewChar = " " + Charact(X-32)
Edit1..Value = Replace(Edit1..Value, OldChar, NewChar)
END
Edit1..Value = NoSpace(Edit1..Value)
Publicado em março, 29 2006 - 8:40 AM
Thanks Glen,
I have wanted to use something like this in the past - thank you for sharing it.
Milton
Is there a control or a setting that Will Capitalize The First Letter In Each Word. If not, the following code works well using a space as a delimeter.
Edit1..Value = " " + Edit1..Value
X is int
OldChar is string
NewChar is string
FOR X = 97 TO 122
OldChar = " " + Charact(X)
NewChar = " " + Charact(X-32)
Edit1..Value = Replace(Edit1..Value, OldChar, NewChar)
END
Edit1..Value = NoSpace(Edit1..Value)
Publicado em novembro, 16 2021 - 8:27 PM
This is an easier way:

StringConverted = Upper(Left(StringToConvert,1))+Lower(Right(StringToConvert,Length(StringToConvert)-1))
Publicado em janeiro, 10 2022 - 1:00 AM
sValor is string = "esto es una prueba"
inicialMayusculas is string = Upper(Left(sValor, 1))
sTexto is string = inicialMayusculas + sValor[[2 TO]]
Publicado em outubro, 24 2022 - 6:59 AM
Good to read this post
Publicado em outubro, 24 2022 - 9:26 AM
sTexto is string
sValor is string = "this is a test"
FOR EACH STRING sWord OF sValor SEPARATED by " "
sTexto += [" "] + Upper(sWord[[1]]) + Lower(sWord[[2 TO)
END


Hope this helps
MerijnW