zoukankan      html  css  js  c++  java
  • 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',
  • 相关阅读:
    发光二极管
    续流二极管作用及工作原理
    python backtrace注意事项
    docker tips
    direct stdin and stdout
    python skill
    mysql comments
    python dict
    python list and tuple
    Python library
  • 原文地址:https://www.cnblogs.com/yangshl/p/6286100.html
Copyright © 2011-2022 走看看