📜  java从字符串中分离数字 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:35.885000             🧑  作者: Mango

代码示例2
int num = 5542;
String number = String.valueOf(num);
for(int i = 0; i < number.length(); i++) {
    int j = Character.digit(number.charAt(i), 10);
    System.out.println("digit: " + j);
}