Menu
Question Index
...

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) {
    }

}

Doubts

Problems

Topic: Java String startsWith() And endsWith() Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App