Skip to content

Tag Archives: cpp-string

Parentheses are said to be balanced when every opening brace has a closing brace like “()()” or “(())” or “(()())” etc. Incorrect balancing includes “)(”… Read More
Given a binary string and a number k, the task is to check whether the binary string is evenly divisible by 2k or not.  Examples… Read More
Given two strings s1 and s2, we need to find number of common base strings of two. A substring of a string s is called… Read More
Given a string s of length n, count the number of substrings having different types of palindromic characteristics. Palindromic Characteristic is the number of k-palindromes in… Read More
Given a String str , the task is to check if the sum of ASCII value of all characters is a Prime Number or not.… Read More
Given an integer N which shows the size of the string and in the next line given a string which contains a string of character… Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function that prints all occurrences of pat[] in txt[]. You may assume that n >… Read More
Member functions String.constructor :  Construct string object (public member function ). String.destructor : String destructor (public member function ) String.operator= : String assignment (public member… Read More
How to convert a single character to a string object.Examples:   Input : x = 'a' Output : string s = "a" Input : x =… Read More
Given two strings, how to check if the two strings are equal or not. Examples:  Input : ABCD, XYZ Output : ABCD is not equal to… Read More
If you are going to perform concatenation in C++, some of the things you must be kept in mind are: If a+b is an expression… Read More
Given a character c and a number n, print the character c, n times. We are not allowed to use loop, recursion and goto. Examples… Read More
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… Read More
Output skeeG rof skeeGGiven a string str, we need to print reverse of individual words. Examples:  Input : Hello World Output : olleH dlroW Input… Read More

Start Your Coding Journey Now!