字符串到整数Smalltalk [英] String to Integer Smalltalk
本文介绍了字符串到整数Smalltalk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
非常简单的问题我需要从用户那里获得一个整数,我只知道如何从中获取一个字符串。因此,如果有办法从用户获取整数或将字符串转换为整数,请告诉我。
Pretty simple question I need to get an integer from the user and I only know how to get a string from them. So if there is a way to get an integer from the user or to convert the string to an integer please let me know.
推荐答案
找到它:
'12345' asNumber.
这篇关于字符串到整数Smalltalk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文