types.String.rstrip
Method on every
stringReturns 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
println($"[{" hi ".rstrip()}]")Output:
[ hi]See also
strip | Returns str with white space removed from both ends. |
lstrip | Returns str with white space removed from the beginning only. |
rstrip | Returns str with white-space characters removed from the end only. |
| string | class index |