I have a string[] array that is split by \r. Each row in the array has title|address in it, but every so often I end up with a duplicate of the address portion of it, which I don't want.
This:
Title1 | Address1 //[0]
Title2 | Address2 //[1]
Title3 | Address1 //[2]
Title4 | Address3 //[3]
Would become:
Title1 | Address1 //[0]
Title2 | Address2 //[1]
Title4 | Address3 //[2]
The array declaration is as follows: string[] resultsArray = results.Split('\r'); //Title|Address I then later split the row when I grab the individual elements by |.
Usage (extremely simplified):
foreach (string result in resultsArray)
{
string splitResult[] = result.Split('|');
title = splitResult[0];
address = splitResult[1];
}
Dictionary<string,string>instead?