- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
public static String getDomain(String str) {
StringBuilder sb = new StringBuilder(str).reverse();
StringBuilder domain = new StringBuilder();
for (String s : sb.toString().split("")) {
if (!s.equals("@")) {
domain.append(s);
} else {
break;
}
}
return domain.reverse().toString();
}