Splitting a String : String join « String « Python






Splitting a String

Splitting a String


li = ['server=mpilgrim', 'uid=sa', 'database=master', 'pwd=secret'] 
s = ";".join(li) 
print s 

print s.split(";")                                       

print s.split(";", 1)                                    

           
       








Related examples in the same category

1.Joining stringsJoining strings
2.Join a listJoin a list
3.String JOINString JOIN
4.Printing a ListPrinting a List
5.split and joinsplit and join