C# find exact-match in string

前端 未结 4 1540
生来不讨喜
生来不讨喜 2021-02-07 22:18

How can I search for an exact match in a string? For example, If I had a string with this text:

label
label:
labels

And I search for label, I only want

4条回答
  •  囚心锁ツ
    2021-02-07 23:05

    It seems you've got a delimiter (crlf) between the words so you could include the delimiter as part of the search string.

    If not then I'd go with Liviu's suggestion.

提交回复
热议问题