• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Core Syntax > String.slice()

String.slice()

JavaScript1.0+, JScript1.0+ NES2+, Nav2+, IE3+, Opera3+ Syntax

							string.slice(num1, num2)

string.slice(num)

Description

The slice() method of an instance of the String object returns the characters in the string between the indexed positions num1 and num2 in which the method is invoked. The string itself is zero based, so the first character is in position 0. It is also possible to pass num2 as a negative number. In this scenario, the string counts from the end of the string to end the slice.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint