Splitting strings : String Split : String : Python examples (example source code) Organized by topic

C++
PHP
Python


Python  »  String   » [  String Split  ]  Screenshots 
 



Splitting strings




string1 = "A, B, C, D, E, F"

print "String is:", string1
print "Split string by spaces:", string1.split()
print "Split string by commas:", string1.split"," )
print "Split string by commas, max 2:", string1.split",")
print


           
       
Related examples in the same category
1.  A sentence is split up into a list of words A sentence is split up into a list of words
2.  Split a string by ',' Split a string by ','
3.  String splits by another string String splits by another string
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.