Help! I need help about monoString

public int GetCount(string itemName)
{
// Assume you have an array or list of items
Item[] items = GetItems();

// Loop through the items and count the ones with the matching name
int count = 0;
foreach (Item item in items)
{
if (item.Name == itemName)
{
count++;
}
}

return count;
}
 
Back
Top Bottom