val a1:String = "ABCDEF"val res12 = List(ABCDEF, null)
at scala.collection.immutable.StringOps.length(StringOps.scala:51)
at scala.collection.SeqLike.siz
嗨,我正在寻找一个解决方案,它将返回给定indexes.For的字符串中的一个子字符串,避免索引绑定异常,目前使用if和else check.Is,还有一个更好的方法(函数式)。 // multiple if check for avoiding index out of bound exception}