Skip to content

Tag Archives: Python-string-functions

Python String rjust() method returns a new string of a given length after substituting a given character on the left side of the original string.… Read More
Python String ljust() method left aligns the string according to the width specified and fills remaining space of line with blank space if ‘fillchr‘ argument… Read More
Python String maketrans() function is used to construct the transition table i.e specify the list of characters that need to be replaced in the whole… Read More
Python string is a sequence of Unicode characters that is enclosed in the quotations marks. In this article, we will discuss the in-built function i.e.… Read More
Given a string S and an integer N, the task is to remove N characters from the end of the string S. Input: S =… Read More
In Python, to find the index of a substring in a string can be located by python’s in-built function using find() or index(). Both of… Read More
In this article, the task is to display the scientific notation as float in Python. The scientific notation means any number expressed in the power… Read More
Both title() and capitalize() have similar functionality of capitalizing first characters. Let us see the difference between the two of them. Method 1: title()  … Read More
In this article we will use str.removeprefix(prefix, /) function which removes the prefix and returns the rest of the string. If the prefix string is… Read More
Given a string in Python. The task is to check whether the string has at least one letter(character) and one number. Return “True” if the… Read More
Prerequisites: Python – format() function str.format() is one of the string formatting methods in Python3, which allows multiple substitutions and value formatting. This method lets… Read More
Title case is a style of writing that is used for the titles of articles, books, movies, and other works. The rules for writing in… Read More
In Python, string capwords() method is used to capitalize all the words in the string using split() method.   Syntax: string.capwords(string, sep=None) Return Value: Returns a formatted… Read More
In Python3, string.octdigits is a pre-initialized string used as string constant. In Python, string.octdigits will give the octadecimal letters ‘01234567’. Syntax : string.octdigits Parameters :… Read More
In Python3, string.punctuation is a pre-initialized string used as string constant. In Python, string.punctuation will give the all sets of punctuation. Syntax : string.punctuation Parameters… Read More

Start Your Coding Journey Now!