in reply to Substring comparison

Use the index function. It does exactly this. See the manual page.