Home > other >  Sorting a list by a specific int
Sorting a list by a specific int

Time:12-16

 GameManager.inventory.item.Add(new Item("Health Potion  :", 2, 1));

the string is the itemName the first int is the count the last int is the iD

I would like to sort multiple itemName by id, but i have no idea how to do it

CodePudding user response:

I presume this is a List so you can use List.Sort

check this question sort a list by field

  • Related