更新时间:2022-01-21 04:32:02
您可以使用 toList
,如下所示:
You can use toList
as follows:
scala> s.toList
res1: List[Char] = List(T, e, s, t)
如果你想要一个数组,可以使用 toArray
If you want an array, you can use toArray
scala> s.toArray
res2: Array[Char] = Array(T, e, s, t)