in reply to Re: Substring comparison
in thread Substring comparison

Cleary 'FFF' is part of string 'FFF NNN JKK III LLL QQQ' and should return a result >= 0
Indeed, and it does. However, the negation of result >= 0 is not if($result <= 0), which is what you wrote in your program. There is a value (0) that's both >= 0 and <= 0.

Use if ($result == -1) in your program.