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
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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 given strings are isomorphic to each other
- Check if strings are rotations of each other or not | Set 2
- Check if two strings are k-anagrams or not
- Check whether two strings are anagram of each other
- Check whether Strings are k distance apart or not
- Check if two strings are permutation of each other
- Check whether two strings are equivalent or not according to given condition
- Check if all the palindromic sub-strings are of odd length
- Check if there is any common character in two given strings
- Check whether two strings contain same characters in same order
- Check whether two strings are anagrams of each other using unordered_map in C++
- Check if two strings are same ignoring their cases
- Check duplicates in a stream of strings
- Check if edit distance between two strings is one
- Check if two strings have a common substring
- Check whether given string can be generated after concatenating given strings
- Check whether an array of strings can correspond to a particular number X
- Python sorted() to check if two strings are anagram or not
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.