I have a string in which the word \"LOCAL\" occurs many times. I used the find() function to search for this word but it returns another word \"Locally\" as wel
find()
Do a regular expression search for \blocal\b
\b is a "word boundry" it can include beginnings of lines, ends of lines, punctuation, etc.
You can also search case insensitively.