當前位置: 首頁>>代碼示例>>Python>>正文


Python strop.lowercase方法代碼示例

本文整理匯總了Python中strop.lowercase方法的典型用法代碼示例。如果您正苦於以下問題:Python strop.lowercase方法的具體用法?Python strop.lowercase怎麽用?Python strop.lowercase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在strop的用法示例。


在下文中一共展示了strop.lowercase方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: lower

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import lowercase [as 別名]
def lower(s):
    """lower(s) -> string

    Return a copy of the string s converted to lowercase.

    """
    return s.lower()

# Convert lower case letters to UPPER CASE 
開發者ID:linuxscout,項目名稱:mishkal,代碼行數:11,代碼來源:string24.py

示例2: swapcase

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import lowercase [as 別名]
def swapcase(s):
    """swapcase(s) -> string

    Return a copy of the string s with upper case characters
    converted to lowercase and vice versa.

    """
    return s.swapcase()

# Strip leading and trailing tabs and spaces 
開發者ID:linuxscout,項目名稱:mishkal,代碼行數:12,代碼來源:string24.py

示例3: replace

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import lowercase [as 別名]
def replace(s, old, new, maxsplit=-1):
    """replace (str, old, new[, maxsplit]) -> string

    Return a copy of string str with all occurrences of substring
    old replaced by new. If the optional argument maxsplit is
    given, only the first maxsplit occurrences are replaced.

    """
    return s.replace(old, new, maxsplit)


# Try importing optional built-in module "strop" -- if it exists,
# it redefines some string operations that are 100-1000 times faster.
# It also defines values for whitespace, lowercase and uppercase
# that match <ctype.h>'s definitions. 
開發者ID:linuxscout,項目名稱:mishkal,代碼行數:17,代碼來源:string24.py

示例4: replace

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import lowercase [as 別名]
def replace(s, old, new, maxreplace=-1):
    """replace (str, old, new[, maxreplace]) -> string

    Return a copy of string str with all occurrences of substring
    old replaced by new. If the optional argument maxreplace is
    given, only the first maxreplace occurrences are replaced.

    """
    return s.replace(old, new, maxreplace)


# Try importing optional built-in module "strop" -- if it exists,
# it redefines some string operations that are 100-1000 times faster.
# It also defines values for whitespace, lowercase and uppercase
# that match <ctype.h>'s definitions. 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:17,代碼來源:string.py


注:本文中的strop.lowercase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。