public class GetEMailHostExample
{
	public String getEMailHost(String emailAddr)
	{
		int index;
		int length = emailAddr.length();
		for(index = 0; index < length; index++)
		{
			if(emailAddr.charAt(index) == '@')
			{
				return(emailAddr.substring(index +1));
			}
		}
		return(null);
	}
	
	public static void main(String args[])
	{
		System.out.println("GetEMailHostExample");
		GetEMailHostExample ex = new GetEMailHostExample();
		String email = "java.joe@sun.com";
		String retString = ex.getEMailHost(email);
		System.out.println("Email host of " + email + ": " + retString);
		email = "com!sun!java.joe";
		retString = ex.getEMailHost(email);
		System.out.println("Email host of " + email + ": " + retString);
	}
}
	
