Python String Function

Python String Function:

We can use the PyCharm code editor for this example. If you do not know about it then follow this link- How to install PyCharm for Python and create a program in it.
lower()Returns the string with all uppercase letters converted to lowercase.
lower() function in Python
upper()Returns the string with all lowercase letters converted to uppercase.
upper() function in Python
title()Returns the string with the first letter of every word in the string in uppercase and the rest in lowercase.
title() function in Python
capitalize()Returns the string with the first letter of the word in the string in uppercase and the rest in lowercase.
capitalize() function in Python
find()This method is used to locate the position of the given substring within the string; find returns -1 if it is unsuccessful in finding the substring.
find() function in Python
index()Same as find() but raises an exception if the substring is not present in the given string.
index() function in Python
isalpha()Returns True if the string contains only letters, otherwise returns False.
isalpha() function in Python
isdigit()Returns True if the string contains only digits and False otherwise.
isdigit() function in Python
isalnum()Returns True if the string contains only letters and digits, i.e., all characters are alphanumeric and Flase otherwise if the string contains any special character like _, @, #, * including space.
isalnum() function in Python

Python Arithmetic Operators
String Concatenation in Python
How to Create Variables in Python
MySQL Tutorial
Computer Software and Hardware
Application Software
Database Models or Data Models
Python (programming language)– Wikipedia

Comments (No)

Leave a Reply