I'm trying to add a list
and a string
in a textbox
with this code
ilaninfotextbox.Text = string.Join(Environment.NewLine, ilantextinner, combinelist);
ilantextinner
is a string
and shows correctly on the textbox
ilantextinner
is a List<string>
with 20 lines in it
But ilantextinner
list is showing like this in the textbox:
System.Collections.Generic.List`1[System.String]
How can I show the contents of ilantextinner
in the textbox?
Note: If I use only ilantextinner
contents are shown correctly.
First, you need to Join the List, to make it a single string:
string joinedList = string.Join(Environment.NewLine, combinelist);
Then you join this string to the TextBox
string:
ilaninfotextbox.Text = string.Join(Environment.NewLine, ilantextinner, joinedList);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With