Functions which perform manipulation on strings.
string.capitalize()
Returns copy of the string with the first character capitalized.
Examples of string.capitalize() in interactive mode:
string.isalnum()
Returns True if the characters in the string are alphanumeric (alphabets or numbers), otherwise False.
Examples of string.isalnum() in interactive mode:
string.isalpha()
Returns True if all the characters in the string are alphabetic, otherwise False.
Examples of string.isalpha() in interactive mode:
string.isdigit()
Returns True if all the characters in the string are digits, otherwise False.
Examples of string.isdigit() in interactive mode:
string.islower()
Returns True if all the cased characters in the string are lowercase, otherwise False.
Examples of string.islower() in interactive mode:
string.isspace()
Returns True if there are only whitespace characters in the string, otherwise False.
Examples of string.isspace() in interactive mode:
string.isupper()
Returns True if all the cased characters in the string are uppercase, otherwise False.
Examples of string.isupper() in interactive mode:
string.lower()
Returns a copy of the string with all the cased characters converted to lowercase.
Examples of string.lower() in interactive mode:
string.upper()
Returns a copy of the string with all the cased characters converted to uppercase.
Examples of string.upper() in interactive mode:
string.find(sub[,start[,end]])
Returns the lowest index of the string where the substring sub is found within the slice range of start and end. Returns -1 if sub is not found.
Examples of string.find(sub[,start[,end]]) in interactive mode: