Source Code : Match Email address
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Match Email address

/**
* SubStringDemo.java separates domain name like "@yahoo.com"
* from email id like "suraj.gupta@yahoo.com"
*
*/
public class SubStringDemo {
/**
* @author suraj.gupta
*/
public static void main(String[] args) {
String s = "suraj.gupta@yahoo.com"; // email id in a String
int IndexOf = s.indexOf("@"); // returns an integer which tells the position of this substring "@" in the parent String "suraj.gupta@yahoo.com"
String domainName = s.substring(IndexOf); //prints the String after that index
System.out.println("Taking Domain name from an email id "+domainName);
}
}
Thank with us