Template:cpp/string/cvt str2int base

Discards any whitespace characters (as identified by calling ) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=) integer number representation and converts them to an {{#ifeq: { | true | unsigned}} integer value. The valid  integer value consists of the following parts:
 * plus or minus sign
 * prefix indicating octal base (applies only when the base is  or )
 * prefix ( or ) indicating hexadecimal base (applies only when the base is or )
 * a sequence of digits

The set of valid values for base is The set of valid digits for base- integers is  for base- integers is  and so on. For bases larger than, valid digits include alphabetic characters, starting from for base- integer, to  for base- integer. The case of the characters is ignored.

Additional numeric formats may be accepted by the currently installed C locale.

If the value of is, the numeric base is auto-detected: if the prefix is , the base is octal, if the prefix is  or , the base is hexadecimal, otherwise the base is decimal.

If the minus sign was part of the input sequence, the numeric value calculated from the sequence of digits is negated as if by unary minus in the result type{{#ifeq:{{{u|}}}|true|, which applies unsigned integer wraparound rules}}.