Check if a string is suffix of another | CPP program to find if a string is suffix of another ; Test case - sensitive implementation of endsWith function
#include <boost/algorithm/string.hpp> NEW_LINE #include <iostream> NEW_LINE #include <string> NEW_LINE using namespace std ; int main ( ) { string s1 = " geeks " , s2 = " geeksforgeeks " ; bool result = boost :: algorithm :: ends_with ( s2 , s1 ) ; if ( result ) cout << " Yes " ; else cout << " No " ; return 0 ; }