String(python)

capitalize()

>>>a = 'test'

>>>a.capitalize()

'Test'

upper()

>>>a = 'test'

>>>a.upper()

'TEST'

lower()

>>>a = 'tEsT'

>>>a.lower()

'test'

center()

>>>a = 'test'

>>>a.center(10)

' test '

reverse string??

>>>a = 'abcdefg'

>>>a[::-1]

'gfedcba'

String to List and then String back

split()

>>>a = "aaa iii uuu eee ooo"

>>>a.split(" ")

['aaa', 'iii', 'uuu', 'eee', 'ooo']

join()

>>>a = ['aaa', 'iii', 'uuu', 'eee', 'ooo']

>>>" ".join(a)

"aaa iii uuu eee ooo"

in case it is number

>>>a = [0,1,2,3,4,5,6]

>>>' '.join(map(str,a))

'0 1 2 3 4 5 6'

Opdigit

import re

s = "name555"

sl = re.findall('\d+', s)

return sl[-1]

or

int(filter(str.isdigit, str1))