#strip-lstrip-rstrip

[ follow ]
#python
fromRealpython
1 week ago
Python

Strip Characters From a Python String - Real Python

Use Python's .strip(), .lstrip(), .rstrip() to remove whitespace or specified characters from string ends; use .removeprefix()/.removesuffix() for exact sequences.
fromRealpython
1 week ago
Python

Strip Characters From a Python String Quiz - Real Python

Use strip, lstrip, and rstrip to remove whitespace or specified characters from string ends and choose the appropriate method for the desired trimming.
[ Load more ]