Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Last active July 13, 2017 18:30
Show Gist options
  • Save SethTisue/736e62168d7569d3d5ca5bfab402c4c7 to your computer and use it in GitHub Desktop.
Save SethTisue/736e62168d7569d3d5ca5bfab402c4c7 to your computer and use it in GitHub Desktop.
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