• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
July 07, 2022 |990 Views

Check if a string is suffix of another

  Share   Like
Description
Discussion

Given two strings s1 and s2, check if s1 is a suffix of s2. Or in simple words, we need to find whether string s2 ends with string s1. 
Input : s1 = "geeks" and s2 = "geeksforgeeks"
Output : Yes

Input : s1 = "world", s2 = "my first code is hello world"
Output : Yes


Check if a string is suffix of another : https://www.geeksforgeeks.org/check-if-a-string-is-suffix-of-another/