Yaswanth Varma has Published 377 Articles

How to find the nth occurrence of substring in a string in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 20-May-2025 11:00:51

5K+ Views

While working with the strings, the common requirement is searching for a specific substring within a larger string. Python provides built-in methods that allow you to locate the first occurrence of a substring. But what if the substring appears multiple times. For example, consider the string "Welcome to the Tutorialspoint ... Read More

How do I split a multi-line string into multiple lines?

Yaswanth Varma

Yaswanth Varma

Updated on 20-May-2025 10:54:47

7K+ Views

A string is a collection of characters that may be used to represent a single word or an entire phrase. Strings are useful in Python since they don't need to be declared explicitly and may be defined with or without a specifier. In this article, we are going to find ... Read More

How to convert a string to a list of words in python?

Yaswanth Varma

Yaswanth Varma

Updated on 20-May-2025 10:36:54

9K+ Views

Strings are one of the most commonly used data types. In this article, we are going to find out how to convert a string to a list of words in Python. Converting the string into a list is helpful when dealing with user inputs or when we want to manipulate ... Read More

How to sort the letters in a string alphabetically in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 20-May-2025 10:28:32

7K+ Views

In Python, Sorting the string alphabetically is a common task helps for string manipulation or text analysis. It is used in creating the anagrams, checking for permutations, or standardizing the input for consistent processing, for example, turning 'banana' into 'aaabnn'. In this article, we will explore how to sort ... Read More

How to find the longest common substring from more than two strings in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 08-May-2025 11:00:26

2K+ Views

The substrings are the sequence of characters that appear within the string. While working with multiple strings, it is useful to find the longest common substring. There are various ways to find the longest common substring from more than two strings. one of the most common approach is using ... Read More

How to convert a Python csv string to array?

Yaswanth Varma

Yaswanth Varma

Updated on 07-May-2025 17:07:05

16K+ Views

The comma-separated values (CSV) is a text format that is used for storing tabular data. In Python, we will come across situations where CSV data is available in string format. For performing operations on this data, we need to convert it into an array. Python provides multiple ways to achieve ... Read More

How to do string concatenation without \\'+\\' operator in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 07-May-2025 16:49:24

2K+ Views

In this article, we are going to find out how to do string concatenation without the plus operator in Python. Generally, String concatenation is the process of joining two or more strings into one, and the common way to do this is by using the '+' operator. For example, ... Read More

How to remove all special characters, punctuation and spaces from a string in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 02-May-2025 20:34:26

7K+ Views

It is necessary to clean up the strings by removing the unwanted elements such as special characters, punctuation, and spaces. These unwanted characters can be involved in the tasks and cause unexpected results. In this article, we are going to learn more about removing all special characters, punctuation and spaces ... Read More

How would you convert string to bytes in Python 3?

Yaswanth Varma

Yaswanth Varma

Updated on 21-Apr-2025 15:59:38

329 Views

In Python, strings and bytes are two different types of data, Where the strings are the sequences of unicode characters used for text representation, While bytes are sequences of bytes used for binary data. Converting strings to bytes is used when we want to work with the raw binary ... Read More

How to check if multiple strings exist in another string in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 21-Apr-2025 15:57:16

10K+ Views

While working with the strings, Checking if the string exists inside another string is a common task and can be achieved by using the in keyword. But, In this article we are going to see how to check if multiple strings exist in another string in Python. For example, ... Read More

Previous 1 ... 7 8 9 10 11 ... 38 Next
Advertisements