Skip to content

Tag Archives: cpp-string

Given two strings, compare the strings using pointers  Examples: Input: str1 = geeks, str2 = geeks Output: Both are equal Input: str1 = hello, str2… Read More
Given a string ‘s’, the task is to check whether the string has both prefix and suffix substrings of length greater than 1 which are… Read More
Given a string containing space-separated words and a number K. The task is to find and print all those words whose length is greater than… Read More
String find is used to find the first occurrence of sub-string in the specified string being called upon. It returns the index of the first… Read More
Given two strings, str1 and str2, the task is to print the indices(Consider, indices starting from 0) of the occurrence of str2 in str1. If… Read More
strcpy() function The strcpy() function is used to copy the source string to destination string. If the buffer size of dest string is more than… Read More
Given a string. The task is to replace each character of the minimized string with a character present at the index ‘IND‘ of the original… Read More
The basic_string::c_str() is a builtin function in C++ which returns a pointer to an array that contains a null-terminated sequence of characters representing the current… Read More
Given a string and an integer M, print all distinct circular strings of length M in lexicographical order.  Examples:  Input: str = “baaaa”, M =… Read More
Given two strings str1 and str2, the task is to count the number of times str2 occurs in str1 using recursion. Examples:  Input: str1 =… Read More
A 10 x 10 Crossword grid is provided, along with a set of words (or names of places) which need to be filled into the… Read More
Given a string, write a recursive program to reverse it.   Method 1 (Using Stack)   C++ // C++ program to reverse a string using stack… Read More
Give a sentence, print different words present in it. Words are separated by space.  Examples:  Input : str = "Geeks for Geeks" Output : Geeks… Read More
Java import java.io.*;   class GFG {   public static void main(String[] args) {                   System.out.println("Enter The String : ");         String str = "geeksforgeeks";         StringBuffer sb… Read More
Given a string s we have to find the lexicographical maximum substring of a string Examples:  Input : s = "ababaa" Output : babaa Explanation… Read More

Start Your Coding Journey Now!