- splice(start?: number, deleteCount?: number, replacement?: string): ((str: string, length?: number, normalizedStart?: number) => string)
-
Parameters
-
start: number = 0
-
Optional deleteCount: number
-
replacement: string = ""
Returns ((str: string, length?: number, normalizedStart?: number) => string)
-
- (str: string, length?: number, normalizedStart?: number): string
-
Parameters
-
str: string
-
length: number = str.length
-
normalizedStart: number = ...
Returns string
Removes characters from a String, and inserts new characters in their place.
Works like Array.prototype.splice
Example
Truncate to 3 characters
Example
Delete the second character
Example
Replace last character with asterisk (
"*")Returns
the spliced String