I have finished a project of mine in c# 2008. but now i need to redo it again to c# 2005 to create an installer(setup and deployment) but i realized that there's no .count method in c# 2005. Please show me the proper conversion of the code below(error is : int cardCount = draw.Count(card => card.StartsWith(value) it's a poker program btw
string[] values = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };
string[] suits = { "♠", "♦", "♣", "♥" };
string[] draw = { "A ♠", "A ♦", "K ♦", "K ♥", "A ♥" };
Boolean threeOf = false;
Boolean twoOf = false;
Boolean fullHouse = false;
// full house, 3 cards of one value, 2 cards of another value
foreach (string value in values)
{
int cardCount = draw.Count(card => card.StartsWith(value));
if (cardCount == 3)
{ threeOf = true; }
if (cardCount == 2)
{ twoOf = true; }
}
if (threeOf && twoOf)
{ fullHouse = true; }