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


Python strop.uppercase方法代碼示例

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


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

示例1: upper

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

    Return a copy of the string s converted to uppercase.

    """
    return s.upper()

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

示例2: replace

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import uppercase [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

示例3: replace

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import uppercase [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

示例4: test_data_attributes

# 需要導入模塊: import strop [as 別名]
# 或者: from strop import uppercase [as 別名]
def test_data_attributes(self):
        strop.lowercase
        strop.uppercase
        strop.whitespace 
開發者ID:dxwu,項目名稱:BinderFilter,代碼行數:6,代碼來源:test_strop.py


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