1.trimEnd:截取末尾几个长度的字符串
import scala.collection.mutable.ArrayBufferval a = ArrayBuffer[Int]()a+=(1,2,3,4,5)a.trimEnd(3) ares15: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(1, 2)
本文共 249 字,大约阅读时间需要 1 分钟。
import scala.collection.mutable.ArrayBufferval a = ArrayBuffer[Int]()a+=(1,2,3,4,5)a.trimEnd(3) ares15: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(1, 2)
转载于:https://www.cnblogs.com/zhaohadoopone/p/11198328.html