Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to split string with comma in python

# We can use the split() function and put a "," in the parameter 
# It'll return a list with the string split up by commas.
txt = "hello, my name is Peter, I am 26 years old"

x = txt.split(",")
print(x)
 
PREVIOUS NEXT
Tagged: #split #string #comma #python
ADD COMMENT
Topic
Name
1+8 =