Python split Function

Python split() method divide a string based on specified separator. split(sep,num):    sep: separator, character or string    num: split times

>>> x = 'EndMemo Python Tutorial'
>>> x.split('th')
['EndMemo Py', 'on Tutorial']
>>> x.split('o')
['EndMem', ' Pyth', 'n Tut', 'rial']
>>> x.split('o',1)
['EndMem', ' Python Tutorial']
















endmemo.com © 2024  | Terms of Use | Privacy | Home