Here is an example of such a function:
CREATE OR REPLACE FUNCTION FindPos( inValue VARCHAR(255), inValues VARCHAR(255) )
RETURNS LONG
BEGIN
DECLARE pos LONG DEFAULT 1;
DECLARE R LONG;
DECLARE delimiterPos LONG;
DECLARE vals VARCHAR(255);
SET vals = inValues;
SET delimiterPos = LOCATE( ';', vals );
WHILE delimiterPos > 0 DO
IF LEFT( vals, delimiterPos - 1 ) = inValue THEN
SET r = pos;
RETURN r;
END IF
SET vals = SUBSTR( vals, delimiterPos + 1 );
SET delimiterPos = LOCATE( ';', vals );
SET pos = pos + 1;
END WHILE
IF vals = inValue THEN
RETURN pos;
ELSE
RETURN 0;
END IF
END;
And how it is used:
SELECT FindPos( '0351A', '2392;0351A;3876B' )
=>2