Python Inbuilt String Functions - Notes
upper()
Converts string to uppercase.
name = "vaish"
print([Link]())
# Output: VAISH
lower()
Converts string to lowercase.
name = "VAISH"
print([Link]())
# Output: vaish
title()
Converts first letter of each word to uppercase.
text = "python developer"
print([Link]())
# Output: Python Developer
capitalize()
Capitalizes first character of string.
text = "python"
print([Link]())
# Output: Python
isalpha()
Returns True if all characters are alphabets.
text = "python"
print([Link]())
# Output: True
isdigit()
Returns True if all characters are digits.
num = "12345"
print([Link]())
# Output: True
isalnum()
Returns True if string is alphanumeric.
text = "python123"
print([Link]())
# Output: True
find()
Returns index of substring.
text = "hello python"
print([Link]("python"))
replace()
Replaces substring with another.
text = "hello world"
print([Link]("world","python"))
startswith()
Checks if string starts with value.
text = "python class"
print([Link]("python"))
endswith()
Checks if string ends with value.
text = "[Link]"
print([Link](".py"))