A voir également:
- Traitement de chaine de caractére en js
- Caractère spéciaux - Guide
- Excel extraire chaine de caractère après un caractère ✓ - Forum Excel
- Caractère invisible ✓ - Forum Windows
- Caractère spéciaux mac clavier - Guide
- Caractère ascii - Guide
2 réponses
Salut, je ne connais quasiment rien en javascript, mais il te suffit de chercher les espaces et de remplacer le caractère suivant par sa majuscule. J'imagine qu'avec les methodes indexOf(), substr() et toUpperCase() par exemple, y'a moyen de moyenner :-D
http://www.w3schools.com/js/js_obj_string.asp (c'est en anglais)
http://www.commentcamarche.net/javascript/jsstring.php3
http://www.w3schools.com/js/js_obj_string.asp (c'est en anglais)
http://www.commentcamarche.net/javascript/jsstring.php3
HackTrack
Messages postés
618
Date d'inscription
vendredi 26 juillet 2002
Statut
Membre
Dernière intervention
13 juillet 2013
972
4 août 2004 à 09:42
4 août 2004 à 09:42
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<!--
Author: Philippe Fery
Creation: Augustus 4, 2004
philippefery@hotmail.com
-->
<head>
<title>Untitled</title>
<script>
function allWordsUpper(text){
newText = "";
words = text.split(" ");
for(i=0 ; i<words.length ; i++){
word = words[i];
word = word.substring(0,1).toUpperCase() + word.substring(1,word.length);
newText +=word;
if(i!=words.length-1){
newText += " ";
}
}
return newText;
}
</script>
</head>
<body>
<script>
alert(allWordsUpper("comment ça marche"));
</script>
</body>
</html>
;-)