用于移除字符串头尾指定的字符(默认为空格)
Help on built-in function strip:
str.strip([chars]) 移除字符串头尾指定的字符
strip(...) method of builtins.str instance
S.strip([chars]) -> str
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
#!/usr/bin/python3 str = "*****this is string example....wow!!!*****" print (str.strip( '*' ))
this is string example....wow!!!