1.切割字符串,将以","把字符串打印出来:如my 98 rr
class Demo1 {
public static void main(String[] args) {
String str3 = "my,98,rr";
for (byte d : b) {
System.out.println(b);
}
}
}
2.电话的正则表达式:
class Demo2{
public static void main(String[] args) {
String regex = "[1][358][0-9]{9}";
String phone = "15978954632";
System.out.println( phone.matches(regex));
}
}
或者
class Demo3{
public static void main(String[] args) {
String regex = "[1][358]\\d{9}";
String phone = "15978954632";
System.out.println( phone.matches(regex));
}
}