What you see there is just the way control characters (ASCII code 0-31) are pretty-printed by the interactive toplevel. For example, #"\^A"
is equivalent to #"\001"
. The SML system presumably uses its own Char.toString
function to print values of type char
. Try chr 65
, which should be printed as #"A"
.
Question
I need to convert an int to its equivalent char using the Char.chr-function, but why does the function return every char in the form of #"\^A"
instead of just #"A"
(that's how I want it to be).
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow