Below is the example of the string.slice() Method.
'Geeks for Geeks'
b = A.slice(0,5);
c = A.slice(6,9);
d = A.slice(10);
Geeks for Geeks
Parameter: This method uses two-parameter startingindex( from which index, the string should be started) and endingindex (before which index, the string should be included).
Return Values: It returns a part or a slice of the given input string.
Ram i am is going to school is going to schoo going to school
Geeks for Geek