用正则做简单明了的很
- package com.heima.text;
- public class Demo3 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- String line = "qazx234567WSXC7654312";
-
- String[] strArr = line.split("\\d{1,}");
- System.out.println(strArr.length);
- System.out.println(strArr[0].toUpperCase());
- System.out.println(strArr[1].toLowerCase());
- }
- }
复制代码 |