Reputation: 111
this.reportTextBox.Text += String.Join(Environment.NewLine, notEqualValue);
This Line of code will print out all of the Tuple values within this list. It will be displayed looking something like this:
(02/12/14 00:00:00, hello)
I only wish to display the Date function of my DateTime method. So it should look like:
(02/12/14, hello)
Is this possible?
The initialization of the Tuple can be seen below.
Tuple<DateTime, string> a = new Tuple<DateTime, string>(data_entryA.Date, tag_a_name);
Upvotes: 1
Views: 263
Reputation: 101701
Sure you can format your dates
var values = notEqualValue.Select(x => string.Join(",",x.Item1.ToString("d"),x.Item2));
this.reportTextBox.Text += String.Join(Environment.NewLine, values);
"d"
format specifier gives you the date in format 6/15/2009
, but it's culture sensitive. So if you have a different culture try using DateTime.ParseExact
method with a custom format string.
Upvotes: 1