//Laver Array Liste
ArrayList Fields123 = new ArrayList();
Fields123.Add("12345");
Fields123.Add("67890");
Fields123.Add("09876");
Fields123.Add("54321");
Fields123.Add("12345");
//Som Variable
foreach (string tbOldField in Fields123)
{
number = number + 1;
string field + number = tbOldField;
}
Dont know the syntax in C#. My problem is that I need the string field to be like:
String field1
String field2
String field3
String field4
String field5
but dont know how to get the "number" in so its is field(number).
ArrayListanymore. It belongs the old days when C# doesn't have Generics. You can useList<T>instead. In your case,Dictionarycould be better.."field1": 12345and"field2": 67890? Is thefield1a variable name/key or is it simply a corresponding value?