So I have a lot of strings in my "BIGLIST" which contain multiple conditions, like this: Colors, country, town, good/bad, day, morning/afternoon/evening/night
there are:
5 colors
5 countries
5 town
2 good/bad
7 days
4 morning/afternoon/evening/night
So, 5*5*5*2*7*2 = 3500 possibilities
Some examples of my data:
green england london good sunday evening
red thenetherlands amsterdam bad monday night
blue america newyork bad tuesday morning
So now I want to sort EVERY possibility into a list. So if you have 2x this possiblity in my BIGLIST : blue america newyork bad tuesday morning, the list: "blueamericanewyorkbadtuesdaymorningList".count will return 2.
Now, I dont feel like make 3500lists, either with another name. And ALSO if I want to sort the BIGLIST this was my idea to do it so far: Is this a good way to do it? are there easier ways?
List<string> colorlist = new List<string>();
colorlist[0] = "blue";
colorlist[1] = "red";
//etc
for (int i = 0;i<BIGLIST;i++)
{
for (int j=0;j<colorlist.count;j++)
{
if(BIGLIST[i].contains(colorlist[j]))
{
//etc
}
}
}
Aucun commentaire:
Enregistrer un commentaire