62,614
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String args[]) throws IOException {
String[] strs = {
"aaaaaa@bbbbbbb@ccccccc",
"bbbbbbbbbbb",
"aaaa@aasdfsdf@",
"@adasfasfdsasdf"
};
for(String str : strs) {
if(str.indexOf("@") >= 0) {
System.out.println(str);
}
}
}
}
public class Test {
public static void main(String args[]) throws IOException {
String[] strs = {
"aaaaaa@bbbbbbb@ccccccc",
"bbbbbbbbbbb",
"aaaa@aasdfsdf@",
"@adasfasfdsasdf"
};
for(String str : strs) {
if(str.matches(".*@.*")) {
System.out.println(str);
}
}
}
}