Parses a text representation of an integer. An optional base to the corresponding integer can be provided. If base is not given, 10 will be used.



  • string: Location of the integer to convert into an ordered digits
  • base: Digit base  E.g. Digit ‘2’ will convert the integer into binary


  • output-location: Location to store the output data

If successful, returns an object in the form of {integer, remainder_of_binary}. Otherwise error.

Raises an error if base is less than 2 or more than 36.

If you want to convert a string-formatted integer directly to an integer, String to Integer can be used instead.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments