本文整理汇总了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())
示例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))
示例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())
示例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))
示例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())
示例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))
示例7: _lower
def _lower(self, ch):
return unichr(unicodedb.tolower(ord(ch)))
示例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())
示例9: Py_UNICODE_TOLOWER
def Py_UNICODE_TOLOWER(space, ch):
"""Return the character ch converted to lower case."""
return unichr(unicodedb.tolower(ord(ch)))
示例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))