Stringstream is stream class present in C++ which is used for doing operations on a string. It can be used for formatting/parsing/converting a string to number/char etc. Hex is an I/O manipulator that takes reference to an I/O stream as parameter and returns reference to the stream after manipulation. Here is a quick way to convert any decimal to hexadecimal using stringstream:...
In this article, we will learn how to convert String To Float/Double And Vice-Versa. In order to do conversion we will be using the following C++ functions:...
Copying a string is a common operation in C/C++ used to create a duplicate copy of the original string. In this article, we will see how to copy strings in C/C++....
Given string str, we need to print the reverse of individual words....
Regular expressions or what we can call regex for short are sequences of symbols and characters that create a search pattern and help us to find specific patterns within a given text. In this article, we will learn how to replace text in a string using regex in C++....
Given an array of strings arr[] consisting of lowercase and uppercase characters only, the task is to modify the array by removing the characters from the strings which are repeating in the same string or any other string. Print the modified array....
Given a positive integer N, representing the count of players playing the game and an array of strings arr[], consisting of the numeric strings made up of digits from the range [‘1’, ‘N’]. Considering ith player is assigned with the string arr[i], the task is to find the winner of the game when all N players play the game optimally as per the following rules:...
Splitting a string by some delimiter is a very common task. For example, we have a comma-separated list of items from a file and we want individual items in an array. Almost all programming languages, provide a function split a string by some delimiter....
Given an array of strings arr[], consisting of strings made up of lowercase and uppercase letters, the task is to print all the strings from the given array that can be typed using keys from a single row of a QWERTY keyboard....
Given string str, the task is to check if characters at the odd indexes of str form a palindrome string or not. If not then print “No” else print “Yes”....
In C++, a string stores a sequence of characters that represents some textual data. The delimiters are used to separate those sequences of characters in a string. This process is called splitting or tokenization. In this article, we will learn how to split a string by a delimiter in C++....