![]() |
VOOZH | about |
The rstrip() method removes trailing whitespace characters from a string. We can also specify custom characters to remove from end of string.
Let's take an example to remove whitespace from the ends of a string.
Hello Python!
s.rstrip(chars)
Table of Content
Hello Python!
If we have a string with various characters that we want to remove from end of the string.
##*#Hello Python!
Notes:
We can also remove the trailing newline characters (\n) from a string.
Hello Python!