I would like to have a proper way to check whether a string is the beginning of another string (and that they are not the same).
Given s1 and s2 I have the following possibilities:
LENGTH(s1) < LENGTH(s2) AND SUBSTR(s2, 1, LENGTH(s1)) = s1
s2 LIKE replace(replace(replace(s1,'\','\\'),'%','\%'),'_','\_') || '_%' ESCAPE '\'
Is there a better way with native functions I don’t know of?
Note: s1 and s2 might contain %, _ or any other characters!
Thanks.
I don’t think it is a better way, but for completeness there is also: