Java Utililty Methods atoi

List of utility methods to do atoi

Description

The list of methods to do atoi are organized into topic(s).

Method

intatoi(String s, int pos, int base)
Method to parse the number in a string.
int num = 0;
int sign = 1;
int len = s.length();
if (pos < len && s.charAt(pos) == '-') {
    pos++;
    sign = -1;
if (base == 0) {
...
intatoi(String str)
Convert a string to integer.
int len = str.length();
int num = 0;
int sign = 1;
for (int i = 0; i < len; i++) {
    char c = str.charAt(i);
    if (c <= ' ')
        continue;
    if (c == '-') {
...
intatoi(String str)
atoi
int retVal = 0;
for (int i = 0; i < str.length(); i++) {
    retVal += (str.charAt(i) - '0') * power(1, str.length() - i - 1);
return retVal;
int[]atoi(String[] s)
atoi
int[] res = new int[s.length];
try {
    for (int i = 0; i < res.length; i++) {
        res[i] = Integer.parseInt(s[i]);
    return res;
} catch (Exception e) {
    return null;
...