- afilter
auto afilter(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- amap
auto amap(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- asort
auto asort(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- auniq
auto auniq(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- contains
bool contains(T[] arr, V val)
Whether array contains value, no BS.
- containsAt
bool containsAt(T[] haystack, T[] needle, size_t offset)
Like startsWith, but with an offset.
- countSort
T[] countSort(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- eat
deprecated bool eat(T[] arr, T[] prefix)
If arr starts with prefix, slice it off and return true.
Otherwise leave arr unchaned and return false.
- get
T get(T[] arr, size_t index)
Like AA.get - soft indexing, throws an
Exception (not an Error) on out-of-bounds,
even in release builds.
- get
auto get(T[] arr, size_t index, T defaultValue)
Like AA.get - soft indexing, returns
default value on out-of-bounds.
- getExpand
T getExpand(T[] arr, size_t index)
Expand the array if index is out-of-bounds.
- indexOf
sizediff_t indexOf(T[] arr, D val)
Complement to std.string.indexOf which works with arrays
of non-character types.
Unlike std.algorithm.countUntil, it does not auto-decode,
and returns an index usable for array indexing/slicing.
- indexOf
sizediff_t indexOf(T[] arr, T[] val)
Undocumented in source. Be warned that the author may not have intended to support it.
- indexOfElement
sizediff_t indexOfElement(T[] arr, D val)
- isIn
bool isIn(T val, T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- isOneOf
bool isOneOf(T val, T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- list
auto list(Args args)
- memcmp
int memcmp(ubyte[] a, ubyte[] b)
Undocumented in source. Be warned that the author may not have intended to support it.
- memmove
void memmove(T[] dst, T[] src)
- padRight
T[] padRight(T[] s, size_t l, T c)
Undocumented in source. Be warned that the author may not have intended to support it.
- pluck
T pluck(T[] arr)
Select and return a random element from the array,
and remove it from the array.
- putExpand
T putExpand(T[] arr, size_t index, T value)
Expand the array if index is out-of-bounds.
- queuePeek
T queuePeek(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- queuePeekLast
T queuePeekLast(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- queuePop
T queuePop(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- repeatOne
T[] repeatOne(T c, size_t l)
Undocumented in source. Be warned that the author may not have intended to support it.
- sample
auto ref sample(T[] arr)
Select and return a random element from the array.
- shift
T shift(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- skipUntil
T[] skipUntil(T[] source, D delim, bool orUntilEnd)
Returns the slice of source up to the first occurrence of delim,
and fast-forwards source to the point after delim.
If delim is not found, the behavior depends on orUntilEnd:
- If orUntilEnd is false (default), it returns null
and leaves source unchanged.
- If orUntilEnd is true, it returns source,
and then sets source to null.
- slice
T[] slice(T[] arr, size_t p0, size_t p1)
Slices an array. Throws an Exception (not an Error)
on out-of-bounds, even in release builds.
- sliceIndex
size_t sliceIndex(T[] arr, T[] slice)
Given an array and its slice, returns the
start index of the slice inside the array.
- splitEmpty
auto splitEmpty(T value, S separator)
Like std.array.split, but returns null if val was empty.
- stackPeek
T stackPeek(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- stackPop
T stackPop(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
- stackPush
void stackPush(T[] arr, T val)
Undocumented in source. Be warned that the author may not have intended to support it.
- toArray
T[] toArray(T v)
- unshift
void unshift(T[] arr, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
- vector
T[] vector(T[] a, T[] b)
Undocumented in source. Be warned that the author may not have intended to support it.
- vectorAssign
T[] vectorAssign(T[] a, T[] b)
Undocumented in source. Be warned that the author may not have intended to support it.
Array utility functions