Search
 
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
Name
3+3 =