string.trimLeft
This function returns a slice of the input string with all the leading Unicode code points contained in cutset removed from the left.
Syntax
string.trimLeft(str, cutset)
Arguments
Argument |
Type |
Description |
---|---|---|
str |
string |
Source string |
cutset |
string |
Set of characters that need to be removed from the left |
Returns
Type |
Description |
---|---|
string |
Slice of the input string with all the leading Unicode code points contained in cutset removed from the left. |
Examples
- The function
string.trimLeft(" Hello World ", " ")
returnsHello World
. - The function
string.trimLeft("¡¡¡Hello, Gophers!!!", "!¡")
" returnsHello, Gophers!!!
.