I am making a listing program and I want to be able to make it so if you add more than one of the same products to the list it changes the string to say productx1, productx2 and so on. Any ideas?
Asked
Active
Viewed 38 times
0
-
3How? don't! Create a class, and have the list contain instances of that class – Mitch Wheat Apr 04 '22 at 09:17
-
1Create a proper object model of a line item with a product and an amount. – Filburt Apr 04 '22 at 09:21
-
1Please see [Microsoft's remarks](https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-6.0#remarks) on using `ArrayList`. – ProgrammingLlama Apr 04 '22 at 09:22
-
Please provide enough code so others can better understand or reproduce the problem. – Community Apr 04 '22 at 09:47
-
you can create a class, struct or tuple and put them in a List. – Cato Apr 04 '22 at 09:53