String in python
String is a collection of character. Example : mycrazycoding2019
String methods
S.No | Methods | Explain |
---|---|---|
string capitalize() | String capitalize is used to capitalize the first character of an given string. | |
string casefold() | String casefold is used to convert the given string into lowercase character. | |
string center() | String center is used to print in the center of the string by special characters based on the indexes. | |
string count() | String count is used to count the single character or set of character in the given string. | |
string expandtabs() | String expandtabs is used to print the tab space in the given string of inbetween places.It will be one or more tab space based on the given integer value. | |
string find() | String find is used to check the given single character or set of character represent in the starting string means it will print the index value. Otherwise it will print -1. | |
string format() | String format is used to print the values in an string format order using the curly brackets({}). | |
string format map() | String format map is used to print the key values in an string format order using the curly brackets({}) in an dictionary. | |
string index() | String index is used to find the particular character of an index values of the given string. | |
string isalnum() | String isalnum is used to check the only alphabets or numbers present in the string or not. | |
string isalpha() | String isalpha is used to check the alphabets present in the string or not. | |
string isdecimal() | String isdecimal is used to check the only numbers present in the string or not. | |
string isdigit() | String isdigit is used to check the only numbers present in the string or not. | |
string isidentifier() | String isidentifier is used to check the only alphabets and only numbers present in the string or not. | |
string islower() | String islower is used to check the only lowercase alphabets present in the string or not. | |
string isnumeric() | String isnumeric is used to check the only numbers present in the string or not. | |
string isprintable() | String isprintable is used to check the given string is printable or not. It will be not printable for all Escape sequences like(\n,\t,etc..). | |
string isspace() | String isspace is used to check the only space present in the string or not. | |
string istitle() | String istitle is used to check the each first character in all the words are uppercase character or not. | |
string isupper() | String isupper is used to check the only uppercase alphabets present in the string or not. | |
string join() | String join is used to join the given list to string. | |
string ljust() | String ljust is used to print the given string left side spaces based on the given index values spaces be allocated. | |
string lower() | String lower is used to convert the given string into lowercase character. | |
string lstrip() | String lstrip is used to remove the given character in the left side of the string. | |
string partition() | String partition is used to split the given single character or set of character in the given string. | |
string replace() | String replace is used to replace the single character or set of characters in an given string. | |
string rfind() | String rfind is used to check the given single character or set of character represent in the string means it will print the index value. Otherwise it will print -1. | |
string rindex() | String rindex is used to find the particular character of an index values in an string. | |
string rjust() | String rjust is used to print the given string in right side spaces based on the given index values spaces be allocated. | |
string rpartition() | String rpartition is used to split the given single character or set of character in the right side of the given string. | |
string rsplit() | String rsplit is used to split the given single character or set of character in the given string. It will finally converts the string into list. | |
string rstrip() | String rstrip is used to remove the given character in the right side of the string. | |
string split() | String split is used to split the given single character or set of character in the given string. It will finally converts the string into split. | |
string startswith() | String startswith is used to check the given single character or set of character starting with the given string or not. | |
string strip() | String strip is used to remove the given character or set of character in the given string. | |
string swapcase() | String swapcase is used to convert the lowercase character to uppercase character and it will converts uppercase character to lowercase character. | |
string title() | String title is used to convert the each first character in all the words into uppercase character in the given string. | |
string upper() | String upper is used to convert the given string into uppercase character. | |
string zfill() | String zfill is used to fill the zero('0') in the left side of the given string based on the given index. |