Basics<T> extension
ads list methods that should have (mostly) been included in the stdlib from the beginning
- on
-
- List<
T>
- List<
Properties
- firstOrNull → T?
-
Available on List<
T> , provided by the Basics extensionno setter - lastOrNull → T?
-
Available on List<
T> , provided by the Basics extensionno setter
Methods
-
at(
int index) → T -
pysublist(
int firstIndex, int lastIndex) → List< T> - provides python like list indexing which accepts negative values
-
rotate(
[int n = 1]) → Iterable< T> -
shift(
T elem) → void - moves all elements of a list on index to the left and ads a new element to the end of a list
-
shiftn(
T elem, int len) → void -
Available on List<
adds theT> , provided by the Basics extensionelem
to the end ofthis
if n is given the first element is popped, if the list is longer thann
-
takeRandom(
int n) → Iterable< T>