Varun

Convert float to string in C++ (3 Ways)

In this article, we will learn about three different ways to convert a float to a string in C++ i.e. Using std::to_string() function Using std::stingstream Using Boost’s lexical_cast() function. Let’s discuss them one by one. Convert float to string using to_string() C++ provides a function std::to_string() for data type conversion. We can use this to …

Convert float to string in C++ (3 Ways) Read More »

C++ – Check if string contains a character

In this article, we will learn about three different ways to check if a string contains a character or not. Check if a string contains a character using string::find() In C++, the string class provides different overloaded versions of function find() to search for sub-strings or characters in the string object. In one of the overloaded versions, …

C++ – Check if string contains a character Read More »

C++ – Convert int to string (3 ways)

In this article, we will learn about three different ways to convert an integer to a string in C++ i.e. Using to_string() function Using stingstream Using Boost’s lexical_cast() function. Let’s discuss them one by one. Convert int to string using to_string() C++ provides a function std::to_string() for converting values of different types to string type. …

C++ – Convert int to string (3 ways) Read More »

Python: Delete specific characters from a string

In this article, we will discuss different ways to remove specific characters from a string in python. For example, we have a string, And we want to delete all occurrences of some specific characters from the string. These specific characters are, ‘&’ ‘#’ ‘@’ ‘!’ ‘;’ ‘,’ ‘:’ ‘\” After removing these specific characters from …

Python: Delete specific characters from a string Read More »

Remove multiple character from a string in Python

In this article, we will discuss four different ways to delete multiple characters from a string in python. Suppose we have a string “A small sample String for testing” and a list of characters that need to be deleted from string i.e. Let’s see how to delete these characters from the string. Delete multiple characters from string using translate() function …

Remove multiple character from a string in Python Read More »

Python: Remove all non-alphanumeric characters from string

Alphanumeric characters contains one mor more, Letters in lowercase i.e. a to z. Letters in uppercase i.e. A to Z. Numbers from 0 to 9. In this article, we will discuss four different ways to remove all non alphanumeric characters from string. These ways are, Using Regex Using join() Using filter() and join() Using for …

Python: Remove all non-alphanumeric characters from string Read More »

Scroll to Top