Ok guys,
I feel foolish here, but I have made a couple random hands of cards and wanted to see the full contents of those cards in a couple of textboxes.
But I suddenly realized that I am not sure how to do this?
If I loop through the twenty cards it will only show me the last one.
I need to concatenate it in an easy fashion. I KNOW that I could simply do this:
string shuffledCards = myCards.arraylist[1].ToString() +\n + myCards.arraylist[2].ToString() and on and on and on... and then place that string in a textBox....
BUT that cannot be the only way or even a good way to do it -- especially since I have 20 cards in each deck....can someone help me here?
Loading

AlanPosted Jun 27, 2007, 5:01 PM
Try this:
using System.Text;
// ........................
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arraylist.Count; i++)
{
sb.Append(arraylist[i].ToString());
if (i < arraylist.Count -1)
sb.Append ("\r\n");
}
textBox1.Multiline = true;
textBox1.Text = sb.ToString();