获取个十百等

langpo / 2024-10-12 / 原文

static  int  baiwei(int i){
String s = Integer.toString(i);
int numericValue = Character.getNumericValue(s.charAt(s.length() - 1));
int numericValue2 = Character.getNumericValue(s.charAt(s.length() - 2));
int numericValue3 = Character.getNumericValue(s.charAt(s.length() - 3));
return numericValue2;
}