Character Class Methods List
Character class methods are methods that can be applied to a character or a string in programming languages such as Java, Python, or Ruby. Here are some commonly used character class methods:
isalnum(): This method returns True if all the characters in the string are alphanumeric (letters or numbers), otherwise it returns False.
isalpha(): This method returns True if all the characters in the string are alphabets, otherwise it returns False.
isdigit(): This method returns True if all the characters in the string are digits, otherwise it returns False.
islower(): This method returns True if all the characters in the string are in lower case, otherwise it returns False.
isupper(): This method returns True if all the characters in the string are in upper case, otherwise it returns False.
isspace(): This method returns True if all the characters in the string are whitespace (space, tab, or newline), otherwise it returns False.
lower(): This method returns a copy of the string in all lower case.
upper(): This method returns a copy of the string in all upper case.
capitalize(): This method returns a copy of the string with the first character capitalized.
swapcase(): This method returns a copy of the string with all the lower case characters converted to upper case and vice versa.
title(): This method returns a copy of the string with the first character of each word capitalized.
find(): This method returns the index of the first occurrence of the specified character or substring in the string.
replace(): This method returns a copy of the string with all occurrences of a specified substring replaced with another substring.
strip(): This method returns a copy of the string with all leading and trailing whitespace removed.
split(): This method splits the string into a list of substrings based on a specified delimiter.