Converting String to integer in Scheme

Hari Chaudhary picture Hari Chaudhary · Oct 15, 2013 · Viewed 20.1k times · Source

How can I convert a string of digits to an integer ? I want "365" to be converted to 365.

What I have tried, string->list then char->integer, but this returns ASCII value of that integer, how can I get that integer ?

Please help.

Answer

DJG picture DJG · Oct 15, 2013

Try: string->number

> (string->number "1234")
1234