Python short course: Some type-specific methods for string in Python
Some type-specific methods for string
In [1]: s = 'spam'
In [2]: s.find('pa')
Out[2]: 1
In [3]: s
Out[3]: 'spam'
In [4]: s.replace('pa', 'xyz')
Out[4]: 'sxyzm'
In [5]: s
Out[5]: 'spam'
Comments
Post a Comment