Popular Python String Methods ( Functions )
Method Description
- count() It returns the number of times a specified value occurs in a string
- capitalize() It converts the first character of a string into upper case
- casefold() Converts string into lower case
- endswith() Returns true if the string ends with the specified value
- find() Searches the string for a specified value and returns the position of where it was found
- index() Searches the string for a specified value and returns the position of where it was found
- isdigit() Returns True if all characters in the string are digits
- islower() Returns True if all characters in the string are lower case
- isalnum() Returns True if all characters in the string are alphanumeric
- isalpha() Returns True if all characters in the string are in the alphabet
- isdecimal() Returns True if all characters in the string are decimals
- isspace() Returns True if all characters in the string are whitespaces
- istitle() Returns True if the string follows the rules of a title
- isupper() Returns True if all characters in the string are upper case
- join() Joins the elements of an iterable to the end of the string
- ljust() Returns a left justified version of the string
- lower() Converts a string into lower case
- upper() Converts a string into upper case
- lstrip() Returns a left trim version of the string
- replace() Returns a string where a specified value is replaced with a specified value
- rsplit() Splits the string at the specified separator, and returns a list
- rstrip() Returns a right trim version of the string
- startswith() Returns true if the string starts with the specified value
- swapcase() Swaps cases, lower case becomes upper case and vice versa
- title() Converts the first character of each word to upper case
- strip() Returns a trimmed version of the string
No comments:
Post a Comment