nxt.algorithm.searching

Algorithms that either improve or complement std.algorithm.searching.`

NOTE: static qualifier on scoped definitions of struct Result is needed for inout to propagate correctly.

Members

Aliases

indexOfAny
alias indexOfAny = indexOfAmong
Undocumented in source.

Functions

all
bool all(T[] haystack, T needle)

Array-specialization of all with element needle.

any
bool any(T[] haystack, T needle)

Array-specialization of any with element needle.

canFind
bool canFind(T[] haystack, T[] needle)
bool canFind(T[] haystack, T needle)

Array-specialization of count with default predicate.

chomp
inout(T)[] chomp(inout(T)[] haystack, T[] needle)

Array-specialization of std.string.chomp with default predicate.

chomp
inout(T)[] chomp(inout(T)[] haystack, T needle)
Undocumented in source. Be warned that the author may not have intended to support it.
chompPrefix
inout(T)[] chompPrefix(inout(T)[] haystack, T[] needle)

Array-specialization of std.string.chompPrefix with default predicate.

chompPrefix
inout(T)[] chompPrefix(inout(T)[] haystack, T needle)
Undocumented in source. Be warned that the author may not have intended to support it.
chompPrefix
inout(char)[] chompPrefix(inout(char)[] haystack)

Array-specialization of std.string.chompPrefix with default predicate.

count
ptrdiff_t count(T[] haystack, T[] needle)
size_t count(T[] haystack, T needle)

Array-specialization of count with default predicate.

count
size_t count(T[] haystack)

Array-specialization of count with default predicate and no needle.

countAmong
ptrdiff_t countAmong(T[] haystack, T[][] needles)
ptrdiff_t countAmong(T[] haystack, T[] needles)

Array-specialization of countAmong with default predicate.

endsWith
bool endsWith(T[] haystack, T[] needle)
bool endsWith(T[] haystack, T needle)

Array-specialization of endsWith with default predicate.

endsWithAmong
bool endsWithAmong(T[] haystack, T[][] needles)
Undocumented in source. Be warned that the author may not have intended to support it.
endsWithAmong
bool endsWithAmong(T[] haystack, T[] needles)

Array-specialization of endsWith with default predicate.

findLastSkip
auto findLastSkip(inout(T)[] haystack, T[] needle)

Array-specialization of findSkip with default predicate that finds the last skip.

findLastSkip
auto findLastSkip(inout(T)[] haystack, T needle)
findLastSplit
auto findLastSplit(inout(T)[] haystack, const(T)[] needle)
auto findLastSplit(inout(T)[] haystack, T needle)

Array-specialization of findLastSplit with default predicate.

findLastSplitAfter
auto findLastSplitAfter(inout(T)[] haystack, T needle)

Array-specialization of findLastSplitAfter with default predicate.

findSkip
auto findSkip(inout(T)[] haystack, T[] needle)
auto findSkip(inout(T)[] haystack, T needle)

Array-specialization of findSkip with default predicate.

findSplit
auto findSplit(inout(T)[] haystack, const(T)[] needle)
auto findSplit(inout(T)[] haystack, T needle)

Array-specialization of findSplit with default predicate.

findSplitAfter
auto findSplitAfter(inout(T)[] haystack, T needle)

Array-specialization of findSplitAfter with default predicate.

findSplitBefore
auto findSplitBefore(inout(T)[] haystack, T needle)

Array-specialization of findSplitBefore with default predicate.

findSplitBefore
auto findSplitBefore(inout(T)[] haystack)

Array-specialization of findSplitBefore with explicit needle-only predicate needlePred.

indexOf
ptrdiff_t indexOf(inout(T)[] haystack, const(T)[] needle)
ptrdiff_t indexOf(inout(T)[] haystack, T needle)
indexOfAmong
ptrdiff_t indexOfAmong(inout(T)[] haystack, T[] needles)

Array-specialization of indexOf with default predicate.

lastIndexOf
ptrdiff_t lastIndexOf(inout(T)[] haystack, const(T)[] needle)
ptrdiff_t lastIndexOf(inout(T)[] haystack, T needle)

Array-specialization of lastIndexOf with default predicate.

main
void main()
Undocumented in source. Be warned that the author may not have intended to support it.
skipOver
bool skipOver(inout(T)[] haystack, T[] needle)
bool skipOver(inout(T)[] haystack, T needle)

Array-specialization of skipOver with default predicate.

skipOverAround
bool skipOverAround(inout(T)[] haystack, T[] needleFront, T[] needleBack)
Undocumented in source. Be warned that the author may not have intended to support it.
skipOverAround
bool skipOverAround(inout(T)[] haystack, T needleFront, T needleBack)

Array-specialization of skipOverBack with default predicate.

skipOverBack
bool skipOverBack(inout(T)[] haystack, T[] needle)
bool skipOverBack(inout(T)[] haystack, T needle)

Array-specialization of skipOverBack with default predicate.

startsWith
bool startsWith(T[] haystack, T[] needle)
bool startsWith(T[] haystack, T needle)

Array-specialization of startsWith with default predicate.

startsWithAmong
bool startsWithAmong(T[] haystack, T[][] needles)
Undocumented in source. Be warned that the author may not have intended to support it.
startsWithAmong
bool startsWithAmong(T[] haystack, T[] needles)

Array-specialization of endsWith with default predicate.

strip
inout(T)[] strip(inout(T)[] haystack, T needle)
inout(char)[] strip(inout(char)[] haystack)

Array-specialization of strip with default predicate.

stripLeft
inout(T)[] stripLeft(inout(T)[] haystack, T needle)
inout(char)[] stripLeft(inout(char)[] haystack)

Array-specialization of stripLeft with default predicate.

stripRight
inout(T)[] stripRight(inout(T)[] haystack, T needle)
inout(T)[] stripRight(inout(T)[] haystack, T[] needles)
inout(char)[] stripRight(inout(char)[] haystack)

Array-specialization of stripRight with default predicate.

Templates

findSplit
template findSplit(needles...)
Undocumented in source.
findSplitAmong
template findSplitAmong(needles...)

Like findSplit but with multiple separator needles known at compile-time to prevent NarrowString decoding.

Meta