正则表达式
package com.example.test.base;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @description:
* @date: 2020/10/17 10:10
*/
public class PatternTest {
public static void main(String[] args) {
String str = "张三10114363";
Pattern pattern = Pattern.compile("\\d");
String[] split = str.split("");
for (int i = 0; i < split.length; i++) {
Matcher matcher = pattern.matcher(split[i]);
if(matcher.matches()) {
System.out.println(split[i]);
String substring = str.substring(i);
System.out.println(substring);
break;
}
}
}
}