Suppose I have a string \'johndoe@hotmail.com\'. I want to store the string before and after \"@\" into 2 separate strings. What would be the easiest method of
\'johndoe@hotmail.com\'
String email = "johndoe@hotmail.com";
String a[] = email.split("@"); String def = null; String ghi = null; for(int i=0;i<a.length;i++){ def = a[0]; ghi = a[1]; }