code: public static int parseNumber(String value) {
          int k = 1;
          int n = 0;
          for (int i = value.length() - 1; i >= 0; i--) {
              char ch = value.charAt(i);
              if (Character.isDigit(ch) == false) {
                  break;
              }
              n += (ch - '0') * k;
              k *= 10;
          }
          return n;
      }
docs: ---