slice() method for array values
Syntax
string.slice(startindex[,endindex]);
endindex is the optional.
Example
str="Merbin joe" ;
alert(str.slice(3)); //return from 3rd character ["bin joe"]
alert(str.slice(3,5)); //return 3 to 5th character ["bi"]
Example Program:- (Editor)
Editor is Loading...
Advertisement
0 nhận xét:
Đăng nhận xét