Menu
Question Index
...

Write a program to compare a specific region inside a string with another specific region in another string.

Input (Integer, String, String, Integer, Integer) Output (Boolean)
6, 'Yours Online Java School', 'Online', 0, 4 true
11, 'Welcome To MeritCampus', 'MERITCAMPUS', 0, 8 false
4, 'computer', 'put', 1, 2 true
3, 'computer', 'put', 1, 2 false
18, 'Yours Online Java School', 'School', 0, 3 true



class ComparingStringsWithRegionMatches
{
    public static void main(String s[])
    {
        String inputString = "Yours Online Java School";
        String subString = "Online";
        System.out.println("Both regions of strings are equals : " + areEquals(6, inputString, subString, 0, 4));

    }


    public static boolean areEquals(int startIndex, String inputString, String subString, int subStringStartIndex, int numberOfChars) {
    }

}

Doubts

Problems

Topic: Java regionMatches() Method - String Comparison

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App