Quirrel4.41.0

types.String.rstrip

Method on every string
string.rstrip(): any

Returns str with white space removed from the end only.

Return value

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

Notes

Takes no arguments. Same implementation as string.rstrip; 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/rstrip.nut
println($"[{"  hi  ".rstrip()}]")
Output:
[  hi]

See also

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