Funzione removeAt() di WMLScript
La funzione removeAt() suddivide una stringa in elementi e elimina l'elemento specificato.
Sintassi
n = String.removeAt(string, index, separator)
Componenti | Descrizione |
---|---|
n | Stringa restituita dalla funzione. |
string | Stringa originale. |
index | Indice dell'elemento da eliminare. |
separator | Separatore. |
Esempio
var a = String.removeAt("Visit CodeW3C.com!",0," "); var b = String.removeAt("Visit CodeW3C.com!",0,"W"); var c = String.removeAt("Visit CodeW3C.com!",-2," "); var d = String.removeAt("Visit CodeW3C.com!",10," ");
Risultato
a = "W3School!" b = "3School!" c = "W3School!" d = "Visit"