Turn string into number in Racket

二次信任 提交于 2019-12-02 00:54:54

Check out their documentation search, it's complete and accurate. Conversion functions usually have the form of foo->bar (which you can assume takes a foo and returns a bar constructed from it).

You sound like you're looking for a function that takes a string and returns a number, and as it happens, string->number does exist, and does pretty much exactly what you're looking for.

Kyle Burton

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!