Answers for "strip in split python"

0

strip in split python

my_string = "blah, lots  ,  of ,  spaces, here "
result = [x.strip() for x in my_string.split(',')]
# result is ["blah", "lots", "of", "spaces", "here"]
Posted by: Guest on December-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language