I'm learing C# right now using Visual Studio Community.
I'm trying to create a method that creates a variable amount of strings, each named differently. I want the name of the string to be "word" + wordcount. I predefined wordcount as 0 and it increases with each time I call this method. So the name would be: 1. word0 2. word1 …
After creating the string, I want to give it a word to hold and safe it inside an array. Though I think I would know how to do this step. (That's just some context for you.)
Is there a way to rename strings? I guess it would work by doing that, if there is one.
As far as I know there is now way to that inc.
What you can use though, is an array. ` int n = 5; // you dynamic length, from user imput or computed int[] words = new int[n]; // create an array of that length
This seems to be pretty much what you asked for.