Function Slice()

Definition and Usage. The slice () method extracts a part of a string. The slice () method returns the extracted part in a new string.  Parameters. The start position. (The first character is 0). The end position (up to, but not including). Default is the string length.  Return Value. The extracted part of the string.