Defining a string

s = 'my first string'

Repeting a string

s = 'cuelhinho, se eu fosse como tu, tirava a mao do bolso e enfiava a mao no ' * 3
s
'cuelhinho, se eu fosse como tu, tirava a mao do bolso e enfiava a mao no cuelhinho, se eu fosse como tu, tirava a mao do bolso e enfiava a mao no cuelhinho, se eu fosse como tu, tirava a mao do bolso e enfiava a mao no '

Replace

'javascriptexample'.replace('javascript', 'python')
'pythonexample'

To Lower

'PYthon'.lower()
'python'

To Upper

'python'.upper()
'PYTHON'

Starts with

'pythonexample'.startswith('python')
True
'pythonexample'.startswith('example')
False

Ends with

'pythonexample'.endswith('python')
False
'pythonexample'.endswith('example')
True

Split

'Helio Albano de Oliveira'.split(' ')
['Helio', 'Albano', 'de', 'Oliveira']
'test1, test2, test3'.split(',')
['test1', ' test2', ' test3']

Remove spaces (left and right)

'        Helio Albano de Oliveira       '.strip()
'Helio Albano de Oliveira'

Remove spaces (only left)

'        Helio Albano de Oliveira'.strip()
'Helio Albano de Oliveira'

Remove spaces (only left)

'        Helio Albano de Oliveira         '.lstrip()
'Helio Albano de Oliveira         '

Remove spaces (only right)

'        Helio Albano de Oliveira         '.rstrip()
'        Helio Albano de Oliveira'

Title

'helio albano'.title()
'Helio Albano'

Substrings

s = '0123456789'

s[0]
'0'

s[1]
'1'
s = '0123456789'

s[0:5]
'01234'

Invert string

s[::-1]
'9876543210'