Search notes:

Python: string.rstrip()

rstrip(char_set) removes all characters in char_set from the right side of a string:
#!/usr/bin/python3

txt  = 'msd45q63v742'

#
#  Remove all digits from the right side:
#
txt_ =  txt.rstrip('0123456789')

print(txt_) # msd45q63v
Github repository about-python, path: /built-in/types/str/rstrip.py
A specific use of rstrip is to remove line breaks from a string's end: rstrip('\n\r'). This is especially useful when the strings are read by iterating over each line in a file. This somewhat imitates the chomp() function in Perl.

See also

The last n characters can be removed from a string with str = str[:-n] (See extracting substrings from strings).
Remove last n characters from a string
str

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759396759, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/types/string/rstrip(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78