在Scala中有如下几种方式来访问字符串中特定位置的字符。
scala> "hello".charAt(1)
res21: Char = e
scala> "hello"(1)
res22: Char = e
scala> "hello".apply(1)
res23: Char = e
在Scala中有如下几种方式来访问字符串中特定位置的字符。
scala> "hello".charAt(1)
res21: Char = e
scala> "hello"(1)
res22: Char = e
scala> "hello".apply(1)
res23: Char = e
转载于:https://my.oschina.net/nenusoul/blog/802102