Scala的对字符串应用
1.trimEnd:截取末尾几个长度的字符串
import scala.collection.mutable.ArrayBuffer val a = ArrayBuffer[Int]() a+=(1,2,3,4,5) a.trimEnd(3) a res15: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(1, 2)
所谓的人生开挂,不过是厚积薄发!
欢迎评论和转载!
import scala.collection.mutable.ArrayBuffer val a = ArrayBuffer[Int]() a+=(1,2,3,4,5) a.trimEnd(3) a res15: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(1, 2)