Link to home
Start Free TrialLog in
Avatar of Dovberman
DovbermanFlag for United States of America

asked on

Search Multidimensional Array for Specific Column Value

I have the following array:

      // Declare array  
        public string[,] arrDeck = new string[3, 4];
 
        // Constructor
        public MainPage()
        {
            InitializeComponent();

           // populate multidimension array (two dimensions)
            arrDeck[0, 0] = "a2";
            arrDeck[0, 1] = "This is not a recommended starting hand";
            arrDeck[0, 2] = "5.4 Pct";
            arrDeck[0, 3] = "153";

            arrDeck[1, 0] = "a2s";
            arrDeck[1, 1] = "You need 3 callers in an unraised pot. You need 4 callers in a raised pot.";
            arrDeck[1, 2] = "12.7 Pct";
            arrDeck[1, 3] = "39";
        }

How do I search to find "a2s" ?

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dovberman

ASKER

I have never used this technique before.  It seems more efficient than a For each or Do Until loop.  I will step through it to get a better understanding.

Thanks,
Yes, the row index is what I needed.  Then I can get other columns from the found row.
Thank  you,
Yes, the row index is what I needed.  Then I can get other columns from the found row.
Thank  you,