Given two strings, the task is to check if these two strings are identical(same) or not.
Input: string1 = “GeeksforGeeks”, string2 = “GeeksforGeeks”
Input: string1 = “Geeks for Geeks”, string2 = “Geeks for Geeks”
Input: string1 = “GeeksforGeeks”, string2 = “Geeks”
Input: string1 = “Geeks for Geeks”, string2 = “Geeks for geeks”
Approach: This can be done with the help of strcmp() method in C. Please note, this method is case-sensitive.
Enter the first string: GeeksForGeeks Enter the second string: GeeksForGeeks Are both strings same: Yes
- A Program to check if strings are rotations of each other or not
- Meta Strings (Check if two strings can become same after a swap in one string)
- Check if two strings are k-anagrams or not
- Check whether Strings are k distance apart or not
- Check whether two strings are anagram of each other
- Check if two given strings are isomorphic to each other
- Check if two strings are permutation of each other
- Check if strings are rotations of each other or not | Set 2
- Check if there is any common character in two given strings
- Check if two strings are same ignoring their cases
- Check duplicates in a stream of strings
- Check if all the palindromic sub-strings are of odd length
- Check whether two strings are equivalent or not according to given condition
- Check whether two strings contain same characters in same order
- Check if edit distance between two strings is one
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.