-
Return the string representing a character whose Unicode code point is the integer i. For example,
chr(97)returns the string'a'. This is the inverse oford(). The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16).ValueErrorwill be raised if i is outside that range.根据ascii码返回某个字符,注意函数参数需要写为 0x XX
chr(i)
-
Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For example,
ord('a')returns the integer97andord('\u2020')returns8224. This is the inverse ofchr().
ord(c)
str.capitalize()
str.isupper()
Return true if all cased characters [4] in the string are uppercase and there is at least one cased character, false otherwise.
str.lower()
Return a copy of the string with all the cased characters [4] converted to lowercase.
str.join(iterable)
TypeError will be raised if there are any non-string values in iterable, including bytes objects. The separator between elements is the string providing this method.
str.lower()
Return a copy of the string with all the cased characters [4] converted to lowercase.
string.lower(s)
本文介绍了Python中字符串操作的基础知识,包括chr()和ord()函数的使用方法,如何将ASCII码转换为字符及反之,字符串首字母大写的方法,判断字符串是否全为大写的功能,以及字符串连接技巧等。
737

被折叠的 条评论
为什么被折叠?



