Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我在 smalltalk(视觉作品)中有一个文本编辑器小部件,它返回一个文本对象,但是我希望返回的文本作为字符串对象处理。
如何将文本对象解析为字符串?
如果Text和String是 VW Smalltalk 中的不同类(我目前不容易访问),看看你是否可以打电话yourText asString或可能String newFrom: yourText或可能yourText as: String。其中大部分都可以在 Squeak Smalltalk 中使用。
Text
String
yourText asString
String newFrom: yourText
yourText as: String
您将 #string 发送到 Text 对象