Ich habe folgendes:
- Eine Hauptliste namens GlobalStrings
- Eine andere Liste namens localStrings
In einer Schleife zum Beispiel:
List<string> GlobalStrings = new List<string>();
List<string> localStrings = new List<string>();
for(x=1;x<10;x++)
{
localStrings.Add("some value");
localStrings.Add("some value");
}
// Want to append localStrings to GlobalStrings as easily as possible
localStrings = new List<string>;sollte vor die forSchleife gestellt werden
Addzu GlobalStringsstatt zu könnte localStrings. Und FWIW you loop läuft nur 9 mal. Besser wärefor (int x = 0; x < 10; ++x) {var localStrings = GetAListOfStrings(); /* append those to GlobalStrings */}