DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python using re trimming white space
import re my_string = " Hello Python " output = re.sub(r'^s+|s+$', '', my_string) print(output)
Source by www.programiz.com #
PREVIOUS
NEXT
Tagged:
#python
#trimming
#white
#space
ADD COMMENT
Topic
COMMENT
Name
3+3 =
Submit