WMLScript removeAt() 函数

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

语法

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

例子

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

结果

a = "51help!"
b = "3School!"
c = "51help!"
d = "Visit"