Here you can find the source of getNameFromEmail(String email)
public static String getNameFromEmail(String email)
//package com.java2s; public class Main { public static String getNameFromEmail(String email) { String nameAddr[] = email.split("@"); return nameAddr[0]; }// w w w . ja va 2 s . c om }