Suppose i have array of strings as follows:
string[] array = new string[6];
array[0] = "http://www.s8wministries.org/general.php?id=35";
array[1] = "http://www.s8wministries.org/general.php?id=52";
array[2] = "http://www.ecogybiofuels.com/general.php?id=6";
array[3] = "http://www.stjohnsheriff.com/general.php?id=186";
array[4] = "http://www.stjohnsheriff.com/general.php?id=7";
array[5] = "http://www.bickellawfirm.com/general.php?id=1048";
Now I want to store only one similar occurrence of the string ie http://www.s8wministries.org/general.php?id=35
discarding any other string that has http://www.s8wministries.org
and store it in another array.
Please how do I go about this?
my attempt is as follows:-
//remove similar string from array storing only one similar in another array
foreach (var olu in array)
{
string findThisString = olu.ToString();
string firstTen = findThisString.Substring(0, 15);
// See if substring is in the table.
int index1 = Array.IndexOf(array, firstTen); //substring is not in table
}