We are moved to new domain
Click -> www.ehowtonow.com
Friday, 8 May 2015

String Region match in Java

Following example shows how to determines region matches in two String using regionMatches() method.

Sample Program

package com.javatutorialcorner.javastring;

public class RegionMatches {

public static void main(String[] args) {
String input1 = "Spring tutorials @ Java Tutorials Corner";
String input2 = "Learn Spring @ Java Tutorials Corner";

boolean isMatched = input1.
regionMatches(24, input2, 20, 16);
System.out.println();
System.out.println(isMatched);

}

}


Result


The above code checks region “Tutorials Corner” matches in both string .



true

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: String Region match in Java Rating: 5 Reviewed By: eHowToNow