TypeScriptStringslice

Extracts a section of a string and returns it as a new string.

Syntax

str.slice(start, end?): string