Minggu, 27 Januari 2019

Slice() String Inwards Javascript

          Return the selected value from string, nosotros tin choose the string value past times using index. If the specified index value is outof attain in addition to hence it volition furnish the -1.
slice() method for array values


Syntax
      string.slice(startindex[,endindex]);

 endindex is the optional.

Example
 str="Merbin joe" ;

alert(str.slice(3));   //return from tertiary grapheme ["bin joe"]
alert(str.slice(3,5)); //return iii to fifth grapheme ["bi"]

Example Program:- (Editor)


Editor is Loading...

Advertisement

Tidak ada komentar:

Posting Komentar