Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #337 Convert string to integer, explicit base

Extract the integer value i from its string representation s, in radix b

Integer i = Integer.valueOf(s, b);
import "strconv"
i, err := strconv.ParseInt(s, b, 0)
i := StrToInt64Base(s, b);
i = int(s, b)
i = s.to_i(b)

New implementation...
< >
programming-idioms.org