Python Tutorial

Tuesday, August 17, 2010

python String Split

'''
    This code is use for split a string
'''
data = " Life#is#very#easy#with#Python  "
data=data.strip()
words = []
words=data.split("#")
print words



Output:
['Life', 'is', 'very', 'easy', 'with', 'Python']

0 comments:

Post a Comment