Posts From 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.

Ways To Extract Digits From A String

2 Easy Ways to Extract Digits from a Python String

Hello, readers! In this article, we will be focusing on the ways to extract digits from a Python String. So, let us get started. 1. Making use of isdigit() function to extract digits from a Python string Python provides us with string.isdigit() to check for the presence of digits in a string. Python isdigit() function […]

Strings In Python

Strings in Python – The Complete Reference

Strings in Python are amongst the widely used data types and are created by enclosing characters in quotes. For example: Strings are enclosed within single quotes or double-quotes. Both of these are considered as strings by the interpreter. Python does not support the ‘character’ datatype but support strings of length one. For example: How to […]

Python Raw Strings

How to use Python Raw Strings?

Hello everyone! In this article, we’ll be looking at how we can use Python raw strings. This is a powerful feature of Python, using which we can introduce “raw-strings”, without escaping any characters. A Python raw string is a normal string, prefixed with a r or R. This treats characters such as backslash (‘\’) as […]

Python String Format Map

Using Python String format_map()

In this article, we’ll take a look at thePython String format_map() method. This method returns a formatted version of the string using a map-based substitution, using curly brackets {}. Let’s understand this properly, using a few examples. Basics of Python String format_map() The Python String format_map() function is available from Python 3.2 onward, so make […]

Python Center() Method

How to use the Python center() method?

Hello, folks! In this article, we will be understanding Python center() function with String, NumPy, and Pandas module. Python center() method with string Python String has a lot of in-built functions to manipulate and deal with strings. The method performs padding on the string with a specific character on both the sides(left and right […]

Python String Isprintable

Python String isprintable()

The Python String isprintable() function can be used to check if a Python string is printable or not. What does this mean exactly? Let’s find out! Python String isprintable() Certain characters in Python strings cannot be directly printed to the console (file). They are classified as “Other” or “Separator” in the Unicode Character Database. Note, […]