Number.valueOfString()

Signature

int valueOfString (String s, int radix)

Domain

action, condition

Description

Returns an int holding the value extracted from the specified String when parsed with the radix given by the second argument. The first argument is interpreted as representing a signed integer in the radix specified by the second argument. The result is an Integer object that represents the integer value specified by the string.

Parameters

NameTypeDescription
sStringA String containing an integer (in the radix specified) to be converted to an int.
radixintThe radix to use when converting the integer in the String s to an int.

Returns

TypeDescription
intThe value of the integer in the String passed based on the passed radix (number base).

Cautions

none

Example


int result = Number.valueOfString (21012, 3);

Result is: result contains: 194