I dont know if this is possible, but i want to assign some sort of number value to a string so i can compare the strings. Im making a card game and the cards are put to a list using a deal method which contains some switches that return "TWO", THREE..."ACE"
Now i have no way of comparing these, like
"ACE" > "TWO"
Any ideas?
How to assign a number value to String
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jaish MathewsRank #225 · 11K reputationPosted Apr 9, 2010, 8:07 AM EDT
using System.Collections.Specialized;
ListDictionary li = new ListDictionary();
li.Add("TWO", 2);
li.Add("THREE", 3);
li.Add("ACE", 4);
if(int.Parse(li["ACE"].ToString()) > int.Parse( li["TWO"].ToString() ))
{
}
Shane11 reputationPosted Apr 9, 2010, 8:17 AM EDT
Jaish MathewsRank #225 · 11K reputationPosted Apr 9, 2010, 8:27 AM EDT
Please mark if your problem resolved.
Shane11 reputationPosted Apr 9, 2010, 8:32 AM EDT