Tuesday 10 December 2013

string pattern matched in java

string pattern in java

public class RegexMatches {
public static void main( String args[] ){
 // String to be scanned to find the pattern.
String line = "xxxx123@gmail.com";
String pattern = "@gmail.com";

if(line.endwith(pattern ))
{
 sysout("Matched");

     }else{
 sysout("Not Matched");
}
}
}

No comments:

Post a Comment