How to get a string from TextIO in sml/ml?
问题 I'm trying to read text from a file in SML. Eventually, I want a list of individual words; however, I'm struggling at how to convert between a TextIO.elem to a string . For example, if I write the following code it returns a TextIO.elem but I don't know how to convert it to a string so that I can concat it with another string TextIO.input1 inStream 回答1: TextIO.elem is just a synonym for char , so you can use the str function to convert it to a string. But as I replied to elsewhere, I suggest