I am new to Scala. I see that there is a method slicefor arrays that can return a sequential slice, for example:
scala> "zero|one|two|three|four|five".split("\\|").slice(2,5)
res3: Array[String] = Array(two, three, four)
Is there syntactic sugar somewhere to accept an arbitrary, non-sequential, non-growing submatrix? Sort of:
scala> "zero|one|two|three|four|five".split("\\|").fictionalMethod(4,1,5)
res3: Array[String] = Array(four, one, five)
source
share