1
我試圖讓下面的代碼在ubuntu linux上運行的dotnet核心工作 - 但得到一個「字符串不包含複製的定義」編譯錯誤在這一行 - 顯然dotnet-core不支持String.Copy:dotnet核心的String.Copy替代
Attendance = String.Copy(markers) };
在dotnet Core中執行淺色字符串複製的最佳方法是什麼?我應該使用string.CopyTo?
感謝
//I want to add an initial marker to each record
//based on the number of dates specified
//I want the lowest overhead when creating a string for each record
string markers = string.Join("", dates.Select(p => 'U').ToArray());
return logs.Aggregate(new List<MonthlyAttendanceReportRow>(), (rows, log) => {
var match = rows.FirstOrDefault(p => p.EmployeeNo == log.EmployeeNo);
if (match == null) {
match = new MonthlyAttendanceReportRow() {
EmployeeNo = log.EmployeeNo,
Name = log.FirstName + " " + log.LastName,
Attendance = String.Copy(markers) };
rows.Add(match);
} else {
}
return rows;
});
可能的重複[如何在.net核心的String.Copy?](http://stackoverflow.com/q/41758338/213550) – VMAtm
類似的問題是的,但這一個被問了2個月前另一個?不知道如何處理這個。 – onemorecupofcoffee
是的,看起來這個問題得到了更少的嘗試,我的壞:( – VMAtm