I have a source file like this:
replace 1 3 xyz
reverse 0 2
print 1 4
And I would like to assign these elements line by line using Array:
val Array(action, start, end, sub) = src.next.split(“ “)
As you can see the 4th element is optional, and I don’t know how I can manage this inconsistency. Is there any way to make the last assignment optional?