Category Python String

Strings – you use it in every program, just like any other programming language. Learn about Strings in Python and how to manipulate them in the Pythonic way.

3 ways to trim a String in Python

3 ways to trim a String in Python

What do you mean by trimming a string and how can you trim a string in Python? When you remove the whitespace around strings of text, in technical terms we call it trimming a string. In this article, we’ll cover…

How to Slice Strings in Python?

How to Slice Strings in Python?

Introduction In this tutorial, we are going to learn how we can slice strings in Python. Python supports the slicing of strings. It is the creation of a new sub-string from the given string on the basis of the user-defined…

Python String casefold()

Python String casefold()

The Python String casefold() method returns a case folded string, and we use this to remove all case distinctions in a string. Let’s look at what this means. Using the Python String casefold() method This belongs to the String class,…

Strip from a String in Python

Strip from a String in Python

Let’s take a look at how we can strip from a string in Python. Python provides us with different ways to remove trailing characters like newlines, spaces, and tabs from a Python String. This is called stripping from a String.…

Python String title() method

Python String title() method

In this article, we will understand the functionality of String title() method. Python String contains a huge number of built-in functions to work with data. We also recently worked on the istitle() method which confirms the title case for a…