public static int NumberLength(Integer num) {

      int len = 1;
      while (num >= 10) {
        num /= 10;
        len++;
      }
      return len;

    }

 

 public static int NumberAt(Integer num, int unit) {
    while (unit-- > 0) num /= 10;
    return num % 10;
 }

 

 posted on 2023-07-20 11:19  laremehpe  阅读(44)  评论(0编辑  收藏  举报