Função removeAt() do WMLScript
A função removeAt() divide a string em elementos e remove o elemento especificado.
Sintaxe
n = String.removeAt(string, index, separator)
Componentes | Descrição |
---|---|
n | String retornada pela função. |
string | String original. |
index | Índice do elemento a ser removido. |
separator | Separador. |
Exemplo
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," ");
Resultados
a = "W3School!" b = "3School!" c = "W3School!" d = "Visit"