String exact match

后端 未结 7 1671
悲哀的现实
悲哀的现实 2020-11-29 08:13

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

7条回答
  •  暖寄归人
    2020-11-29 09:05

    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.

提交回复
热议问题