python3中str的函数


# 转换
# 'capitalize',
# 'lower',
# 'upper',
# 'casefold',
# 'swapcase', 大小写互换
# 'title',
# 'strip',
# 'rstrip',
# 'lstrip',
# 'replace', 替换
# 'maketrans', 转换
# 'translate',

# 增加字符到指定的长度
# 'center',
# 'ljust',
# 'rjust',
# 'zfill'

# 查找字符串
# 'count',
# 'find', 没有返回-1
# 'rfind',
# 'index', 功能和find一样,但是若没找到会报错ValueError
# 'rindex',

# 编码
# 'encode',

# 判断是否
# 'startswith',
# 'endswith',
# 'expandtabs',
# 'isalnum',
# 'isalpha',
# 'isdecimal',
# 'isdigit',
# 'isidentifier',
# 'islower',
# 'isnumeric',
# 'isprintable',
# 'isspace',
# 'istitle',
# 'isupper',

# 格式化
# 'format',
# 'format_map',

# 拆分
# 'split',
# 'rsplit',
# 'splitlines',
# 'partition',
# 'rpartition',

# 联合
# 'join',


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM