Traveller
New Contributor II

The best option I found to replace CHARINDEX was LOCATE, examples from the Spark documentation below

> SELECT locate('bar', 'foobarbar', 5);

7

> SELECT POSITION('bar' IN 'foobarbar');

4