Skip to content

2015-7: Just in (Upper) Case

Membership X∊Y returns a boolean array of shape ⍴X with 1s indicating where elements of Y occur in X. For a vector X this results in a very convenient boolean mask.

In many instances, it is desirable to perform case-insensitive comparisons and operations. Write a function to perform case-insensitive membership between two arrays.

For full marks, consider membership of cells in high-rank arrays, your function should still return a vector when comparing cells of the same rank, for example (3 2⍴⎕A) and (1 2⍴'cd').

Examples:

      'dyalog' (your_function) 'APL'
0 0 1 1 0 0
      'bramley' (your_function) 'HAMPSHIRE'
0 1 1 1 0 1 0
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub