C#C
C#3y ago
morry329#

✅ input string is not correct format

Context: I was playing around the advent-of-code posted by someone else, a line of his code kept giving me this error
ìnput string is not correct format
I tried tryparse etc but to no avail. The precise error position is at line 15
var targetY = int.Parse(data[0]);
the full code is here: https://github.com/bradwilson/advent-2022/blob/main/day15/Program.cs

I read a lot of SO posts about the input not converted to int (which triggered the error)
, but here he uses
[0]
so would it be enough for the input to be parsed int? (this is my uneducated guess)
GitHub
Advent of Code 2022 (C# 11/.NET 7). Contribute to bradwilson/advent-2022 development by creating an account on GitHub.
Was this page helpful?