zoukankan      html  css  js  c++  java
  • Python——String类型操作符

    Python has comprehensive support for processing strings

    MethodFunctionality
    s.find(t) index of first instance of string t inside s (-1 if not found)
    s.rfind(t) index of last instance of string t inside s (-1 if not found)
    s.index(t) like s.find(t) except it raises ValueError if not found
    s.rindex(t) like s.rfind(t) except it raises ValueError if not found
    s.join(text) combine the words of the text into a string using s as the glue
    s.split(t) split s into a list wherever a t is found (whitespace by default)
    s.splitlines() split s into a list of strings, one per line
    s.lower() a lowercased version of the string s
    s.upper() an uppercased version of the string s
    s.title() a titlecased version of the string s
    s.strip() a copy of s without leading or trailing whitespace
    s.replace(t, u) replace instances of t with u inside s
  • 相关阅读:
    @codeforces
    Spark源码剖析
    大数据自动化安装部署方案(一)
    Spark源码剖析
    Spark源码剖析
    Spark源码剖析
    Spark源码剖析
    Spark源码剖析
    Spark源码剖析
    Spark源码剖析
  • 原文地址:https://www.cnblogs.com/LCharles/p/10869165.html
Copyright © 2011-2022 走看看