- String Built-in Methods (2/2)
String Built-in Methods (2/2)
| Function | Description |
|---|---|
| isalnum() | Python string isalnum() function returns True if it’s made of alphanumeric characters only. |
| isalpha() | Python String isalpha() function returns True if all the characters in the string are alphabets, otherwise False. |
| isdecimal() | Python String isdecimal() function returns True if all the characters in the string are decimal characters, otherwise False. |
| isdigit() | Python String isdigit() function returns True if all the characters in the string are digits, otherwise False. |
| isidentifier() | Python String isidentifier() function returns True if the string is a valid identifier according to the Python language definition. |
| islower() | Python String islower() returns True if all cased characters in the string are lowercase and there is at least one cased character, otherwise it returns False. |
| isnumeric() | Python String isnumeric() function returns True if all the characters in the string are numeric, otherwise False. If the string is empty, then this function returns False. |
| isprintable() | Python String isprintable() function returns True if all characters in the string are printable or the string is empty, False otherwise. |
| isspace() | Python String isspace() function returns True if there are only whitespace characters in the string, otherwise it returns False. |
| istitle() | Python String istitle() returns True if the string is title cased and not empty, otherwise it returns False. |
| isupper() | Python String isupper() function returns True if all the cased characters are in Uppercase. |
| rjust(), ljust() | Utility functions to create a new string of specified length from the source string with right and left justification. |
| swapcase() | Python String swapcase() function returns a new string with uppercase characters converted to lowercase and vice versa. |
| partition() | Python String partition() function splits a string based on a separator into a tuple with three strings. |
| splitlines() | Python String splitlines() function returns the list of lines in the string. |
| title() | Python String title() function returns a title cased version of the string. |
| zfill() | Python String zfill(width) function returns a new string of specified width. The string is filled with 0 on the left side to create the specified width. |