转:
- public boolean isDigit(String strNum) {
- return strNum.matches("[0-9]{1,}");
- }
-
- public boolean isDigit(String strNum) {
- Pattern pattern = Pattern.compile("[0-9]{1,}");
- Matcher matcher = pattern.matcher((CharSequence) strNum);
- return matcher.matches();
- }
-
-
- public String getNumbers(String content) {
- Pattern pattern = Pattern.compile("\\d+");
- Matcher matcher = pattern.matcher(content);
- while (matcher.find()) {
- return matcher.group(0);
- }
- return "";
- }
-
- public String splitNotNumber(String content) {
- Pattern pattern = Pattern.compile("\\D+");
- Matcher matcher = pattern.matcher(content);
- while (matcher.find()) {
- return matcher.group(0);
- }
- return "";
- }
posted @
2020-08-04 15:13
戈博折刀
阅读(
1008)
评论()
收藏
举报