É mais simples usar o split.
No caso a funcao separa :
public String[] separa(String email) {
String[] retorno = email.split(@);
return retorno;
}
SDS,
Bruno Emanuel.
Luiz Paulo Cieslak wrote:
)
String[] componentes = separa([EMAIL PROTECTED]);
public String[]
)
String[] componentes = separa([EMAIL PROTECTED]);
public String[] separa(String email) {
String[] retorno = new String[2];
String retorno[0] = email.substring(0, email.indexOf(@));
String retorno[1] = email.substring(email.indexOf(@) + 1);
return retorno;
}
Um outro exemplo básico é