Utils/sequtils

Source   Edit  

Nim lacks find with start, stop param

Note: functions in this module assume start..<stop in valid range. (a.k.a. it's caller's responsibility to check 0 <= start <= stop < s.len)

Procs

proc contains[T](s, sub: openArray[T]): bool {.inline.}
Source   Edit  
proc find[T](s, sub: openArray[T]; start = 0; stop = s.len): int
Source   Edit  
proc findWithoutMem[A, B](key: typedesc; self: openArray[A]; sub: openArray[B];
                          start = 0; stop = self.len): int
Source   Edit  

Iterators

iterator findAll[T](s, sub: openArray[T]; start = 0): int
Source   Edit  
iterator findAll[T](s, sub: openArray[T]; start = 0; stop: int): int
Source   Edit  
iterator findAll[T](s: openArray[T]; x: T): int
Source   Edit  
iterator findAllWithoutMem[A, B](key: typedesc; self: openArray[A];
                                 sub: openArray[B]; start = 0; stop = self.len): int
Source   Edit  

Templates

template find[T](s: openArray[T]; x: T; start: int): untyped
Source   Edit  
template find[T](s: openArray[T]; x: T; start: int; stop: int): untyped
Source   Edit  
template findAll[T](s: openArray[T]; x: T; start: int): untyped
Source   Edit  
template findAll[T](s: openArray[T]; x: T; start: int; stop: int): untyped
Source   Edit