Fonction charAt() WMLScript
La fonction charAt() retourne le caractère à la position spécifiée.
Syntaxe
n = String.charAt(string, index)
Composant | Description |
---|---|
n | La chaîne retournée par la fonction. |
string | Une chaîne. |
index | Définir un nombre pour une position d'index dans une chaîne. |
Exemple
var a = String.charAt("world",2); var b = String.charAt("world",0); var c = String.charAt("world",10);
Résultat
a = "r" b = "w" c = ""