Tag: Characters
Remove certain characters from a String in C++
In this article, we will learn how to remove certain characters from a string in C++. Table Of Contents Problem Description Method 1: Using while loop Method 2: Using STL function for_each(), erase() and remove() Special Notes about remove() and erase() Summary Problem Description Suppose we have a string sampleStr, and an array of characters …
How to Sort characters of a String in C++?
In this article, we will discuss how to sort characters ina string in C++. Table Of Contents Problem Description Sort characters in a string using an array in C++ Sort characters in a string using STL function std::sort() Summary Problem Description Here we are given an a string, and we have to sort this string. …
Count number of characters in a string array in C++
This tutorial will discuss about unique ways to count number of characters in a string array in C++. Suppose we have a string array, like this, std::string arr[] = {“First”, “Second”, “Third”, “Fourth”}; Now we want to count the total number of characters in this string array. For that, we need to iterate over all …
Count number of characters in a string array in C++Read More
Get string between two characters in C++
This tutorial will discuss about unique ways to get string between two characters in C++. Suppose we have a string, and we want to get a substring from this main string. We will have two characters, and we need to fetch a substring between these two specific characters from the main string. For example, Main …
JavaScript: Convert ASCII Code to Characters
While working with javascript strings and characters, we may encounter a requirement to convert the ASCII value to specific characters. This article demonstrates easy ways to covert the ASCII code to their respective characters using different methods and various example illustrations. ASCII codes are the numeric value given to the characters and symbols for storing …