C++

Check if a string contains certain characters in C++

In this article, we will discuss different ways to check if a string contains certain characters or not. Suppose we have a sequence of characters like, We want to check if a given string contains all of these characters or not. Let’s see how to do this, Check if a string contains certain characters using […]

Check if a string contains certain characters in C++ Read More »

Convert Long to String in C++ | (3 ways)

In this article, we will learn about three different ways to convert a long 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 long to string using to_string() C++ provides a function std::to_string() for converting values of different types to string type.

Convert Long to String in C++ | (3 ways) Read More »

Convert double to string in C++ – (3 ways)

In this article, we will learn about three different ways to convert a double 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 double to string using to_string() C++ provides a function std::to_string() for data type conversion. We can use this to

Convert double 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 »

Scroll to Top