2016-03-18 5 views

ответ

1
String str = "[email protected]"; 
// get the index of `@` and then get content after it. 
String res = str.substring(str.indexOf('@') + 1); 
System.out.println(res); // abc 
+0

Большое спасибо – FreeKill

1

Вы можете сделать что-то вроде этого:

String email = "so[email protected]"; 
String res = email.split("@")[1]; 
System.out.println(res); 
+0

Спасибо за помощь! – FreeKill

Смежные вопросы