在 uwp 函数中,我这样调用:
var selectedDates = sender.SelectedDates.Select(p => p.Date.Month.ToString() + "/" + p.Date.Day.ToString()).ToArray();
var values = string.Join(", " + (string[])selectedDates);
CalendarViewResultTextBlock.Text = values;
但是我在编译它们的时候遇到了一个错误:
Error CS0121 The call is ambiguous between the following methods or properties: 'string.Join(string, params object[])' and 'string.Join(string, params string[])'
谁知道怎么解决?谢谢。
最佳答案
尝试以下操作:
var values = string.Join(", ", (string[]) selectedDates );
(去掉+号)
关于c# - C# string.Join 上的奇怪编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57642336/