Created
April 10, 2017 09:10
-
-
Save lameroid/763568e4dd00cb7a4e1ccf02b804e056 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
operator fun <T, A, B, C> T.getSlice(first: A, last: B, step: C) | |
operator fun <T, A, B, C, S> T.setSlice(first: A, last: B, step: C, value: S) | |
and we can use them: | |
operator fun <T> List<T>.getSlice(first: Int = 0, last: Int = size - 1, step: Int = 1) | |
list[first:] | |
list[first:last] | |
list[first:last:step] | |
list[:last] | |
list[:last:step] | |
list[first: :step] | |
list[: :step] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment