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