Turn string into number in Racket

后端 未结 2 861
眼角桃花
眼角桃花 2020-12-21 11:56

I used read to get a line from a file. The documentation said read returns any, so is it turning the line to a string? I have problems

2条回答
  •  轮回少年
    2020-12-21 12:14

    Looks like this was answered in another question:

    Convert String to Code in Scheme

    NB: that converts any s-expression, not just integers. If you want just integers, try:

    string->number
    

    Which is mentioned in

    Scheme language: merge two numbers

    HTH

提交回复
热议问题