Check the given input string is starts with given prefix or not - Java Quiz Question


Write a program to check the given input string is starts with given prefix or not.

Input (String, String) Output (Boolean)
'meritCampus', 'merit' true
'Vijayawada', 'Vijay' true
'Java School', 'java' false
'MeritCampus', Campus false



class IsStartsWithGivenPrefix
{
    public static void main(String s[])
    {
        String inputString = "meritCampus";
        String prefix = "merit";
        System.out.println("The input string is starts with " + prefix + ": " + isStartsWith(inputString, prefix));

    }


    public static boolean isStartsWith(String inputString, String prefix) {
    }

}