© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
8 replies
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
ì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]);
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]
[0]
so would it be enough for the input to be parsed int? (this is my uneducated guess)
GitHub
advent-2022/Program.cs at main · bradwilson/advent-2022
Advent of Code 2022 (C# 11/.NET 7). Contribute to bradwilson/advent-2022 development by creating an account on GitHub.
advent-2022/Program.cs at main · bradwilson/advent-2022
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

System.FormatException 'Input string was not in a correct format.' - Correct format is entered
C#CC# / help
4y ago
✅ System.FormatException: 'Input string was not in a correct format.'
C#CC# / help
2y ago
It's working fine but the error is 'Input string was not in a correct format.'
C#CC# / help
3y ago