I am needing to create a list of numbers from an uploaded file, if the numbers have "-" representing a range, I need to split the numbers, making the first number a start, iterate through til it gets to the second number. I know I will be storing the numbers in a List, I'm just not sure on how to break out the numbers in the file with "-", Here is an example of the file:
099985-10043
102609-102886
102917-102921
106100-106101
110684-110685
114886-114887
117765-117766
120604-120605
121157-121158
121627-121911
122539
and here is where I am with the code:
if(string.IsNullOrEmpty(fileName.Text)) return;
_MissingInt = new List<int>();
var lines = File.ReadAllLines(fileName.Text);
foreach (string line in lines) {
...need help with logic...
}
I would greatly appreciate any direction and help as my programming skills are pretty weak and I am learning...this is not homework
I didn't agree with Badiparmagi's answer as its adding string/character to int list, its not compilable code. Here giving you my tested attempt. I hope it may help you.