Python: String, Check Case, Char Class
Check Character Case, Character Class
str.isalnum()
-
Return
True
if all characters are alphanumeric and there is at least one character, elseFalse
. str.isalpha()
- ◇
str.isdigit()
- ◇
str.isupper()
- ◇
str.islower()
- ◇
str.isspace()
- Check whitespace characters.
str.istitle()
-
True
if every word start with cap letter. unicode.isnumeric()
-
Return
True
if there are only numeric characters in S, False otherwise.Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH.
unicode.isdecimal()
-
Return
True
if there are only decimal characters in unicode,False
otherwise.Decimal characters include digit characters, and all characters that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.
str.translate(table, ?deleteChars)
-
Return a copy of the string where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256.
You can use the maketrans() helper function in the string module to create a translation table. For string objects, set the table argument to None for translations that only delete characters:
Python, String
- Python: Quote String
- Python: Triple Quote String
- Python: Raw String
- Python: String Prefix Char
- Python: f-String (Format, Template)
- Python: String Escape Sequence
- Python: Unicode Escape Sequence
- Python: Print String
- Python: Print Without Newline
- Python: Convert to String
- Python: Join String
- Python: Format String
- Python: String Methods
- Python: Search Substring
- Python: Split String
- Python: String, Check Case, Char Class
- Python: Letter Case Conversion
- Python: Unicode 🐍
- Python 2: Unicode Tutorial