Quirrel4.41.0

types.String.lstrip

Method on every string
string.lstrip(): any

Returns str with white space removed from the beginning only.

Return value

A new string with the leading white space removed; trailing white space, if any, is kept. See string.lstrip for which bytes count as white space.

Notes

Takes no arguments. Same implementation as string.lstrip; see the Notes on types.String.strip for how the two forms differ only in their reported attributes, not their behavior.

Example

examples/types/string/lstrip.nut
println($"[{"  hi  ".lstrip()}]")
Output:
[hi  ]

See also

stripReturns str with white space removed from both ends.
rstripReturns str with white space removed from the end only.
lstripReturns str with white-space characters removed from the beginning only.
stringclass index