The starting string
The index of the first character to include in the returned substring.
Optional
indexEnd: numberThe index of the first character to exclude from the returned substring.
A new string containing the extracted section of the string.
This function mirrors the
slice
function from the JavaScript Standard String object. It handles Unicode code points instead of UTF-16 character codes.Extracts a section of this string and returns it as a new string, without modifying the original string.