String splits by another string : String Split « String « Python






String splits by another string

String splits by another string

line = "i'mSPAMaSPAMlumberjack"
print line.split("SPAM")

           
       








Related examples in the same category

1.Splitting stringsSplitting strings
2.A sentence is split up into a list of wordsA sentence is split up into a list of words
3.Split a string by ','Split a string by ','