Python String Operations - Definitions
[Link]()
Replaces a specified substring with another substring in a string and returns a new modified string.
string append
Appending means adding one string to the end of another string. In Python, this is commonly done
using the + operator.
upper()
Converts all characters in a string to uppercase letters.
lower()
Converts all characters in a string to lowercase letters.
split()
Splits a string into a list of substrings based on a specified separator. If no separator is given, it
splits by spaces.
isalnum()
Returns True if all characters in the string are alphanumeric (letters or numbers) and the string is
not empty.
isalpha()
Returns True if all characters in the string are alphabetic letters and the string is not empty.
isdigit()
Returns True if all characters in the string are digits (numbers) and the string is not empty.
type()
Returns the data type of a variable or value.
center()
Aligns the string in the center of a specified width by adding padding (usually spaces) on both sides.
len()
Returns the total number of characters present in a string.
count()
Returns the number of times a specified substring appears in a string.