Parameters: This method uses two parameters. This method does not change the original string.
- startingIndex: from which index, the extraction of the string should be started.
- endingIndex: before which index, the extraction of the string should be included.
Return Values: It returns a part or a slice of the given input string.
Below is an example of the string.slice() Method.
Geeks for Geeks
Some more examples are shown below:
Ram i am is going to school is going to schoo going to school
Geeks for Geek
- Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Internet Explorer 4 and above
- Opera 4 and above
- safari 1 and above
Please Login to comment...