code: public static long atol( String s ) {
          int i = 0;
  
          while( i < s.length() && Character.isWhitespace(s.charAt(i)) ) {
              i++;
          }
          if (i < s.length() && s.charAt(i) == '0') {
              if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X')) {
                  return parseLong(s.substring(i + 2), 16);
              } else {
                  return parseLong(s, 8);
              }
          } else {
              return parseLong(s, 10);
          }
      }
docs: Converts a string of digits (decimal, octal or hex) to a long integer
  
  @param s      a string
  
  @return the numeric value of the prefix of s representing a
  base 10 integer