Tag: Character
Get string before a character in C++
This tutorial will discuss about a unique way to get string before a character in C++. To get a substring before a specific character in a string, first we need to check if the given character exists in the string or not. If string contains the specified character, then we need to fetch its index …
Get String after a character in C++
This tutorial will discuss about a unique way to get string after a character in C++. To get a substring from a string, after a specific character, first we need to check if the string contains the specified character or not. If yes, then we need to fetch the index position of its first occurrence. …
Check if string contains any non ASCII character in C++
This tutorial will discuss about a unique way to check if string contains any non ascii character in C++. We can use the all_of() function to check if all the characters in a string satisfies a given condition or not. To check if there is any non ASCII character in a string, we can confirm …
Check if string contains any non ASCII character in C++Read More
Check each character in a string for a condition in C++
This tutorial will discuss about a unique way to check each character in a string for a condition in C++. To check if each character in string satisfies a condition, we need to iterate over all the characters in string and check each character one by one. Although, we can use a for loop for …
Check each character in a string for a condition in C++Read More
Javascript: Remove First and Last Character from String
This article will remove leading and trailing characters from a javascript string using different methods and example illustrations. While developing in any language, removing the first and last characters from the string is common before processing it, as it might be an address or URL. We will discuss both cases: if the character is known …
Javascript: Remove First and Last Character from StringRead More