当前位置: 首页>>代码示例>>Python>>正文


Python unicodedb.tolower函数代码示例

本文整理汇总了Python中pypy.module.unicodedata.unicodedb.tolower函数的典型用法代码示例。如果您正苦于以下问题:Python tolower函数的具体用法?Python tolower怎么用?Python tolower使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了tolower函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: unicode_capitalize__Unicode

def unicode_capitalize__Unicode(space, w_self):
    input = w_self._value
    if len(input) == 0:
        return W_UnicodeObject.EMPTY
    builder = UnicodeBuilder(len(input))
    builder.append(unichr(unicodedb.toupper(ord(input[0]))))
    for i in range(1, len(input)):
        builder.append(unichr(unicodedb.tolower(ord(input[i]))))
    return W_UnicodeObject(builder.build())
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:9,代码来源:unicodeobject.py

示例2: unicode_capitalize__Unicode

def unicode_capitalize__Unicode(space, w_self):
    input = w_self._value
    if len(input) == 0:
        return W_UnicodeObject.EMPTY
    result = [u'\0'] * len(input)
    result[0] = unichr(unicodedb.toupper(ord(input[0])))
    for i in range(1, len(input)):
        result[i] = unichr(unicodedb.tolower(ord(input[i])))
    return W_UnicodeObject(u''.join(result))
开发者ID:gorakhargosh,项目名称:pypy,代码行数:9,代码来源:unicodeobject.py

示例3: unicode_swapcase__Unicode

def unicode_swapcase__Unicode(space, w_self):
    input = w_self._value
    builder = UnicodeBuilder(len(input))
    for i in range(len(input)):
        unichar = ord(input[i])
        if unicodedb.islower(unichar):
            builder.append(unichr(unicodedb.toupper(unichar)))
        elif unicodedb.isupper(unichar):
            builder.append(unichr(unicodedb.tolower(unichar)))
        else:
            builder.append(input[i])
    return W_UnicodeObject(builder.build())
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:12,代码来源:unicodeobject.py

示例4: unicode_swapcase__Unicode

def unicode_swapcase__Unicode(space, w_self):
    input = w_self._value
    result = [u'\0'] * len(input)
    for i in range(len(input)):
        unichar = ord(input[i])
        if unicodedb.islower(unichar):
            result[i] = unichr(unicodedb.toupper(unichar))
        elif unicodedb.isupper(unichar):
            result[i] = unichr(unicodedb.tolower(unichar))
        else:
            result[i] = input[i]
    return W_UnicodeObject(u''.join(result))
开发者ID:gorakhargosh,项目名称:pypy,代码行数:12,代码来源:unicodeobject.py

示例5: unicode_title__Unicode

def unicode_title__Unicode(space, w_self):
    input = w_self._value
    if len(input) == 0:
        return w_self
    builder = UnicodeBuilder(len(input))

    previous_is_cased = False
    for i in range(len(input)):
        unichar = ord(input[i])
        if previous_is_cased:
            builder.append(unichr(unicodedb.tolower(unichar)))
        else:
            builder.append(unichr(unicodedb.totitle(unichar)))
        previous_is_cased = unicodedb.iscased(unichar)
    return W_UnicodeObject(builder.build())
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:15,代码来源:unicodeobject.py

示例6: unicode_title__Unicode

def unicode_title__Unicode(space, w_self):
    input = w_self._value
    if len(input) == 0:
        return w_self
    result = [u'\0'] * len(input)

    previous_is_cased = False
    for i in range(len(input)):
        unichar = ord(input[i])
        if previous_is_cased:
            result[i] = unichr(unicodedb.tolower(unichar))
        else:
            result[i] = unichr(unicodedb.totitle(unichar))
        previous_is_cased = unicodedb.iscased(unichar)
    return W_UnicodeObject(u''.join(result))
开发者ID:gorakhargosh,项目名称:pypy,代码行数:15,代码来源:unicodeobject.py

示例7: _lower

 def _lower(self, ch):
     return unichr(unicodedb.tolower(ord(ch)))
开发者ID:Qointum,项目名称:pypy,代码行数:2,代码来源:unicodeobject.py

示例8: unicode_lower__Unicode

def unicode_lower__Unicode(space, w_self):
    input = w_self._value
    builder = UnicodeBuilder(len(input))
    for i in range(len(input)):
        builder.append(unichr(unicodedb.tolower(ord(input[i]))))
    return W_UnicodeObject(builder.build())
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:6,代码来源:unicodeobject.py

示例9: Py_UNICODE_TOLOWER

def Py_UNICODE_TOLOWER(space, ch):
    """Return the character ch converted to lower case."""
    return unichr(unicodedb.tolower(ord(ch)))
开发者ID:mozillazg,项目名称:pypy,代码行数:3,代码来源:unicodeobject.py

示例10: unicode_lower__Unicode

def unicode_lower__Unicode(space, w_self):
    input = w_self._value
    result = [u'\0'] * len(input)
    for i in range(len(input)):
        result[i] = unichr(unicodedb.tolower(ord(input[i])))
    return W_UnicodeObject(u''.join(result))
开发者ID:gorakhargosh,项目名称:pypy,代码行数:6,代码来源:unicodeobject.py


注:本文中的pypy.module.unicodedata.unicodedb.tolower函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。