我正在尝试将字符串转换为 UTF-8 并将其存储在共享首选项中,但在获取其值后,我无法将包含字节数组的字符串转换为字符串
var myString ="hello world"
var bytes :ByteArray = myString.toUtf8Bytes()
value of Bytes // [104, 101, 108, 108, 111, 32, 109, 121, 32, 119, 111, 114, 108, 100]
var result :String = bytes.contentToString()
value of result // "[104, 101, 108, 108, 111, 32, 109, 121, 32, 119, 111, 114, 108, 100]"
如何从结果中获取 myString 的值?
提前致谢