Funzione charAt() di WMLScript
La funzione charAt() restituisce il carattere situato nella posizione specificata.
Sintassi
n = String.charAt(string, index)
Componente | Descrizione |
---|---|
n | Stringa restituita dalla funzione. |
string | Una stringa. |
index | Definisce un numero in una posizione di sottindicizzazione di una stringa. |
Esempio
var a = String.charAt("world",2); var b = String.charAt("world",0); var c = String.charAt("world",10);
Risultato
a = "r" b = "w" c = ""