[Solved] C# Declare multiple dynamically named variables [duplicate]
Don’t try to use dynamically named variables. That’s simply not how variables work in C#. Use an array of lists: List<string>[] user = new List<string>[infoForUserSessions.Count]; for (int i = 0; i < infoForUserSessions.Count; i++) { user[i] = new List<string>(); } If the number of sessions can change, you would use a List<List<string>> instead, so that … Read more