StringStream in C++ for Decimal to Hexadecimal and back
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:...
read more
C++ Program to Check String is Containing Only Digits
Prerequisite: Strings in C++...
read more
C++ String to Float/Double and Vice-Versa
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:...
read more
Different ways to copy a string in C/C++
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++....
read more
Reverse individual words
Given string str, we need to print the reverse of individual words....
read more
How to Replace Text in a String Using Regex in C++?
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++....
read more
Modify array of strings by replacing characters repeating in the same or remaining strings
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....
read more
Find the winner of game of repeatedly removing the first character to empty given string
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:...
read more
How to split a string in C/C++, Python and Java?
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....
read more
Print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard
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....
read more
Check given string is oddly palindrome or not | Set 2
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”....
read more
How to Split a String by a Delimiter in C++?
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++....
read more