Skip to content

Instantly share code, notes, and snippets.

@commy2
Last active May 9, 2021 11:07
Show Gist options
  • Save commy2/fe39a22d4b3befcc2a02576223d9277d to your computer and use it in GitHub Desktop.
Save commy2/fe39a22d4b3befcc2a02576223d9277d to your computer and use it in GitHub Desktop.

rfind

#define RFIND(h,n) (call {\
    private _offset = count (h) - count (n);\
    private _index = _offset - (reverse (h) find reverse (n));\
    [_index, -1] select (_index > _offset)\
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment