PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Capitalize First Letter In Each Word
Capitalize First Letter In Each Word
Débuté par Glenn Rathke, 28 mar. 2006 16:31 - 5 réponses
Posté le 28 mars 2006 - 16:31
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)
Posté le 29 mars 2006 - 08:40
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)
Posté le 16 novembre 2021 - 20:27
This is an easier way:

StringConverted = Upper(Left(StringToConvert,1))+Lower(Right(StringToConvert,Length(StringToConvert)-1))
Posté le 10 janvier 2022 - 01:00
sValor is string = "esto es una prueba"
inicialMayusculas is string = Upper(Left(sValor, 1))
sTexto is string = inicialMayusculas + sValor[[2 TO]]
Posté le 24 octobre 2022 - 06:59
Good to read this post
Posté le 24 octobre 2022 - 09:26
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