slice()
Extracts a part of the text.
Syntax
text.slice(start, end)
Description
Returns the slice from start to end (end exclusive). Negative index counts from the end.
Returns
Subtext (string).
Example
Loading editor…
Expected output
Hex ary
When to use?
Taking the first N characters, slicing extensions/suffixes.