📜  将 foreach 转换为 linq c# 代码示例

📅  最后修改于: 2022-03-11 14:48:42.686000             🧑  作者: Mango

代码示例4
foreach (var customer in customers)
            {
                customer.Email = !string.IsNullOrEmpty(customer.Name) && !string.IsNullOrEmpty(customer.Last) ? $"{customer.Name}.{customer.Last}{customer.Email.Substring(customer.Email.IndexOf("@"))}" : customer.Email;
            }