Skip to content

Tag Archives: python-string

Removing spaces from a string involves eliminating any whitespace characters within the string. This can be accomplished using various methods in Python. By removing spaces… Read More
Let’s take a password as a combination of alphanumeric characters along with special characters, and check whether the password is valid or not with the… Read More
Given a string, toggle the characters of those words who have all their characters in the same case.  Examples: Input : Geeks for Geeks Output :… Read More
Python String lstrip() method returns a copy of the string with leading characters removed (based on the string argument passed). If no argument is passed,… Read More
Python String translate() returns a string that is a modified string of givens string according to given translation mappings.  There are two ways to translate.… Read More
Given a string str, the task is to extract all the numbers from a string and find out the most occurring element of them using… Read More
Given a string, print all the possible substrings which are also the prefix of the given string. Examples: Input : ababc Output : a, ab,… Read More
In Python, while operating with String, one can do multiple operations on it. Let’s see how to iterate over the characters of a string in… Read More
Given a list of dates in string format, write a Python program to sort the list of dates in ascending order. Examples: Input : dates… Read More
Write a Python program to convert a given string to DateTime in Python.  Below are the methods that we will cover in this article: Using… Read More
Given a list of strings, the task is to sort that list based on given requirement. There are multiple scenarios possible while sorting a list… Read More
Given a list, write a Python program to convert the given list to string. There are various situations we might encounter when a list is… Read More
Given a tuple of characters, Write a python program to convert the tuple into a string.  Examples:  Input : ('a', 'b', 'c', 'd', 'e') Output… Read More
The generic problem faced by the programmers is remove unwanted characters from a string using Python. But sometimes the requirement is way above and demands… Read More
Given a string S consisting only of lowercase letters, the task is to check if the frequency of all characters of the string is unique. Examples:… Read More