![]() |
VOOZH | about |
The slice() is an inbuilt function used to extract a section of a string and return a new string.
string.slice( beginslice [, endSlice] )This method accepts two parameters as mentioned above and described below:
This method returns the index of the regular expression inside the string. Otherwise, it returns -1.
Example 1:
Output:
GeeksforgeeksExample 2:
Output:
Best Platform