String Methods in Python

In This Topic You Will Learn About String Methods in Python. we have four types of methods in Strings String Count,String Join,String Ends With,String Capitalize

String Count

str.count() – string method counts the number of occurrences of the sub-string, in string the given index range of [start, end]. will start and end are optional arguments.

String Join

str.join() – string  Join method accepts an iterable as argument, joins all the items in the iterable and returns the resulting string.

String Ends With

str.endswith() – string Ends with method is used to check if the string ends with the sub-string passed as argument; in the given index range of [start, end], if provided.

String Capitalize

str.capitalize() – string capitalize function returns string with its first character converted to upper case.