Check the given input string is ends with given suffix or not - Java Quiz Question


Write a program to check the given input string is ends with given suffix or not.

Input (String, String) Output (Boolean)
'MeritCampus', 'Campus' true
'HYDERABAD', 'BAD' true
'Java School', 'Java' false
'MeritCampus', campus false



class IsEndsWithGivenSuffix
{
    public static void main(String s[])
    {
        String inputString = "MeritCampus";
        String suffix = "Campus";
        System.out.println("The input string is ends with " + suffix + ": " + isEndsWithSuffix(inputString, suffix));

    }


    public static boolean isEndsWithSuffix(String inputString, String suffix) {
    }

}