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 ", " ") returns Hello World.
  • The function string.trimLeft("¡¡¡Hello, Gophers!!!", "!¡")" returns Hello, Gophers!!!.