strings.ltrim

Supported in:
strings.ltrim(string_to_trim, cutset)

Description

Trims leading white spaces from a given string. This function removes leading characters present in that cutset.

Param data types

STRING, STRING

Return type

STRING

Code samples

The following are example use cases.

Example 1

This example uses the same first and second argument.

strings.ltrim("str", "str") = ""
Example 2

This example uses an empty string as the second argument.

strings.ltrim("str", "") = "str"
Example 3

This example uses an empty string as the first argument, and a string as the second argument.

strings.ltrim("", "str") = ""
Example 4

This example uses strings that contain white spaces, and a string as the second argument.

strings.ltrim("a aastraa aa ", " a") = "straa aa "