Find
From NARS2000
|
||||
| L and R are arbitrary arrays of any rank, shape, or datatype.
But to be useful,
|
||||
| Z is a Boolean array of the same rank and shape as R where each 1 represents the upper left corner of a place in R of a match with L. |
If L is a scalar, then L⍷R ←→ R∊L.
If L is not a scalar, then it represents a contiguous pattern, which may or may not be found in one or more places in R.
If the arguments are numeric, then the result is sensitive to ⎕CT.
For example:
R←3 8⍴'thirteenfourteenfifteen '
R
thirteen
fourteen
fifteen
't'⍷R
1 0 0 0 1 0 0 0
0 0 0 0 1 0 0 0
0 0 0 1 0 0 0 0
'teen'⍷R
0 0 0 0 1 0 0 0
0 0 0 0 1 0 0 0
0 0 0 1 0 0 0 0
(2 4⍴'teen')⍷R
0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0