I have a int array with for example {1,2,3,4} value.
I want to put this numbers into, for example, my list box like this :
listBox2.Items.Add("After Inserting (" + page[i].ToString() + ')' + <use all my numbers like this : 1234 here>+"Page Fault = " + pf.ToString());
Output :
After Inserting (3) 1234 page fault = 5
1234 is just an example. My array is much bigger.
How can I do that in c#?
You can use
String.Join(actually theIEnumerable<T>overload is taken):You can use
String.Formatto build the text and to increase readability:Edit 2:
Yes, you can replace the output:
Edit 3:
Here we go …