string1=" 123 1234 12 14 hello "
string2="123hello world 123"
"""
string.lstrip() 截掉string左边(开始)的空白字符
string.rstrip() 截掉string右边(开始)的空白字符
string.strip() 截掉string左右两边的空白字符
strip()里面还可以指定截掉的字符串
"""
print(string1.strip())
print(string1.lstrip())
print(string1.rstrip())
print(string2.strip('123'))
控制台输出:



