So I made a simple c# file reader because I was bored and added an if statement to filter the results. But when I ran it, it gave me more results than I wanted. I was supposed to get
276, 2
, and there was only one line inside the file with that value, but I got multiple. I checked the file and it had lines ending with the same value. I tried string.Equals(line, "276, 2")
but it gave me the same results. I doubt there isn't something in c# that doesn't solve this issue.
Asked
Active
Viewed 49 times
-1

Daedalus
- 1
- 4
-
2Coud you please share the a [mre] (code and data)? – Klaus Gütter Sep 12 '21 at 04:12
1 Answers
-1
You can use Regex, as it's mentioned in this issue
bool result = Regex.IsMatch(line, "\\b276, 2\\b");

fmansour
- 555
- 3
- 17