Skip to content

Instantly share code, notes, and snippets.

@SethTisue SethTisue/array-view
Last active Jul 13, 2017

What would you like to do?
scala> Array("a", "b", "c", "d")
res0: Array[String] = Array(a, b, c, d)
scala> res0.view.slice(1, 3)
res1: scala.collection.mutable.IndexedSeqView[String,Array[String]] = SeqViewS(...)
scala> res1.toList
res2: List[String] = List(b, c)
scala> res1(0) = "zzz"
scala> res1.toList
res5: List[String] = List(zzz, c)
scala> res0
res6: Array[String] = Array(a, zzz, c, d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.