Skip to content

Tag Archives: python-string

Python String splitlines() method is used to split the lines at line boundaries. The function returns a list of lines in the string, including the… Read More
The strip() method in-built function of Python is used to remove all the leading and trailing spaces from a string. Syntax :string.strip([chars]) Parameter: chars(optional): Character… Read More
Python String rfind() method returns the highest index of the substring if found in the given string. If not found then it returns -1. Syntax: … Read More
Python String isidentifier() method is used to check whether a string is a valid identifier or not. The method returns True if the string is… Read More
strip() is an inbuilt function in Python programming language that returns a copy of the string with both leading and trailing characters removed (based on… Read More
Python program to Split a string based on a delimiter and join the string using another delimiter. Split a string can be quite useful sometimes,… Read More
Python String rindex() method returns the highest index of the substring inside the string if the substring is found. Otherwise, it raises an exception. Syntax: … Read More
replace() is an inbuilt function in the Python programming language that returns a copy of the string where all occurrences of a substring are replaced… Read More
1. String rjust() The string rjust() method returns a new string of given length after substituting a given character in left side of original string.… Read More
Given K and a binary number, check if there exists k consecutive 1’s in the binary number. Examples: Input : binary number = 101010101111 k… Read More
Python library provides a number of built in methods, one such being startswith() and endswith() function which used in string related operations. startswith() Syntax str.startswith(search_string,… Read More
zfill() method returns a copy of the string with ‘0’ characters padded to the leftside of the given string. Syntax : str.zfill(length) Parameters : length… Read More
split() method in Python split a string into a list of strings after breaking the given string by the specified separator. Syntax : str.split(separator, maxsplit)… Read More
min() is an inbuilt function in Python programming language that returns the minimum alphabetical character in a string. Syntax: min(string) Parameter: min() method takes a… Read More
max() is an inbuilt function in Python programming language that returns the highest alphabetical character in a string. Syntax: max(string) Parameter: max() method takes a… Read More

Start Your Coding Journey Now!