|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > String > removeAt()
removeAt() - The removeAt Function
Usage: removeAt(string, index, separator)
Description: Returns a new string where the element and the corresponding separator (if existing) with the given index are removed from the given string. If the index is less than 0 then the first element is removed. If the index is larger than the number of elements then the last element is removed. If the string is empty, the function returns a new empty string.
If the index is of type floating-poing, Float.int() is first used to calculate the actual index value.
Example:var a = "A A; B C D";
var s = " ";
var b = String.removeAt(a, 1, s); // b = "A B C D"
var c = String.removeAt(a, 0, ";"); // c = " B C D"
var d = String.removeAt(a, 14, ";"); // d = "A A"
Bookmark this page
|
|