Handbook
Glossary
subseq-index ( seq subseq -- i/f )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Searching sequences
Prev:
subseq-start-from ( subseq seq n -- i/f )
Next:
subseq-index-from ( n seq subseq -- i/f )
Vocabulary
sequences
Inputs
seq
a
sequence
subseq
a
sequence
Outputs
i/f
a start index or
f
Word description
Outputs the start index of the first contiguous subsequence equal to
subseq
. If no matching subsequence is found, outputs
f
.
Definition
USING:
kernel
;
IN:
sequences
:
subseq-index
( seq subseq -- i/f )
[
0
]
2dip
subseq-index-from
;
inline