WMLScript removeAt() 関数

removeAt() 関数は文字列を要素に分割し、指定された要素を削除します。

構文

n = String.removeAt(string, index, separator)
要素 説明
n 関数から返される文字列。
string 元の文字列。
index 削除する要素のインデックス。
separator 区切り文字。

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," ");

結果

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