FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 27
→
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
Connectez-vous…
Glenn Rathke
#1
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)
Signaler
0
0
Milton Kirkwood
#2
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)
Signaler
0
0
Alfredo
#3
Posté le 16 novembre 2021 - 20:27
This is an easier way:
StringConverted = Upper(Left(StringToConvert,1))+Lower(Right(StringToConvert,Length(StringToConvert)-1))
Signaler
1
0
YusteIbiza
#4
Posté le 10 janvier 2022 - 01:00
s
Valor is string
=
"esto es una prueba"
inicialMayusculas is string
=
Upper
(
Left
(
s
Valor
,
1
)
)
s
Texto is string
=
inicialMayusculas
+
s
Valor
[
[
2
TO
]
]
Signaler
0
0
Egypt
#5
Posté le 24 octobre 2022 - 06:59
Good to read this post
Signaler
0
0
MerijnW
#6
Posté le 24 octobre 2022 - 09:26
s
Texto
is string
s
Valor
is string
=
"this is a test"
FOR
EACH STRING
s
Word OF
s
Valor SEPARATED
by
" "
s
Texto
+
= [
" "
] +
Upper
(
s
Word
[
[
1
]
]
) +
Lower
(
s
Word
[
[
2
TO
)
END
Hope this helps
MerijnW
Signaler
0
0
→ Revenir à WINDEV 27
WINDEV 27
WEBDEV 27
WINDEV Mobile 27
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte