Python判断字符串是否为字母或者数字
isdigit
、isalpha
、isalnum
、islower
、isupper
isspace
:判断字符是否为空格,其中换行符(\n)、回车符(\r)、换页符(\f)均返回true
istitle
:判断第一个字母是否为大写字母
Python中字符串、序列的遍历
enumerate
or for i in range(len(foo))
:
Python 判断文件是否存在的三种方法
os.path.exists(filename)
python_如何去除字符串中不想要的字符?
strip
、rstrip
、lstrip
去掉两端的字符
切片+拼接
替换replace