WMLScript removeAt() 函数

removeAt() 函数把字符串划分为元素,并删除指定的元素。

语法

n = String.removeAt(string, index, separator)
成分 描述
n 从函数返回的字符串。
string 原始字符串。
index 要删除的元素的下标。
separator 分隔符。

例子

var a = String.removeAt("Visit 3wschool!",0," ");
var b = String.removeAt("Visit 3wschool!",0,"W");
var c = String.removeAt("Visit 3wschool!",-2," ");
var d = String.removeAt("Visit 3wschool!",10," ");

结果

a = "3wschool!"
b = "3School!"
c = "3wschool!"
d = "Visit"