This tutorial explains about Python String.
Python String Methods
|Method | Description | Example
|:——–| ————— |
|capitalize()| Capitalize first letter of an string |
str.capitalize()
-> Test |
|islower()| Checks lower case or not |str.islower()
-> False|
|isupper()| Checks uppercase or not |str.isupper()
-> True|
|isnumeric()| checks numeric string or not| str.isnumeric()
-> False|
|isalnum() | Check alphanumerics or not | str.isalnum()
-> True|Python Length of a String
Length is the number of characters in a given string, It might contain spaces and Unicode characters.
For example, “abc” length is 3, and “hi def” length is 6.
Python provides len()
function to find the length of a string.