#!/usr/bin/env python
# Author:liujun
name = "my name is aliex"
print(name.capitalize())
# Capitalize the first letter
print(name.count('a'))
# Count the number of specified character
print(name.center(50, "-"))
# The result is ----------------------aliex-----------------------
print(name.endswith("x"))
# Decide whether the string end with specified character and return boolean
print(name.find("name"))
print(name.find("y"))
# Get the index of the first character of the given string
name = "my name is {name} and i am {year} old"
print(name.format(name="alex",year=33))
print(name.isalnum())
print(name.isalpha())
print(name.isdigit())
# Decide if it is a digit
print(name.isdecimal())
# Decide if it is decimal
print(name.isidentifier())
# Decide if it is a valid identifier.
print(name.islower())
print(name.isupper())
print(name.isnumeric())
print(name.istitle())
print(name.isprintable())
print('+'.join( ['1','2','3']) )
print( name.ljust(50,'*') )
print( name.rjust(50,'-') )
print( 'Alex'.lower() )
print( 'Alex'.upper() )
print( '
Alex'.lstrip() )
print( 'Alex
'.rstrip() )
print( ' Alex
'.strip() )
p = str.maketrans("abcdefli",'123$@456')
print("alex li".translate(p) )
print('alex li'.replace('l','L',1))
print('alex lil'.rfind('l'))
print('1+2+3+4'.split('
'))
print('1+2
+3+4'.splitlines())
print('Alex Li'.swapcase())
print('lex li'.title())
print('lex li'.zfill(50))