Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split string with a seperator

text = 'geeks for geeks'
  
# Splits at space
print(text.split())
  
word = 'geeks, for, geeks'
  
# Splits at ','
print(word.split(','))
  
word = 'geeks:for:geeks'
  
# Splitting at ':'
print(word.split(':'))
  
word = 'CatBatSatFatOr'
  
# Splitting at t
print(word.split('t'))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #split #string #seperator
ADD COMMENT
Topic
Name
2+5 =