In a program I'm writing, I'm accessing a url that is simply a list of numerical data and "-" in lines separated by commas, i.e.
66-43-221, 5651-5546, ....
66-43-221, 5641-5546, ....
I know how to open the link, use arrays and commas as a splitter to reference various parts of the data, etc., but I'm having a problem. I want to store all of second values (i.e. the 5651-5546) in an array based on having a common first value (i.e. 66-43-221). However, I have no idea what code to use to say "while the first string in the array is the same" all the way down the list. It's not like I can go while (Array.equals(Array). And I can't just write a while loop with .equals("the first number here") because the data sheet has various first values, not just one.
Thanks for your help ahead of time.
Re: String help
You could use a Map where the Key is the first number (66-43-221) and the Value would be a List of all the second numbers (5651-5546, 5641-5546, etc).
Originally Posted by Username14