lstrip
rstrip
split
Removes trailing whitespace (or specified characters).
str.rstrip(chars?)
Enter values below to update the example in real time.
print
text = " hello world " print(text.rstrip()) # " hello world"