📜  c# list to string replace last comma with and - C# 代码示例

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

代码示例1
var test = "Service Control Manager repeated 5 times, Microsoft-Windows-DistributedCOM repeated 2 times, Control Manager repeated 6 times.";
        var lastComma = test.LastIndexOf(',');
        if (lastComma != -1) test = test.Remove(lastComma, 1).Insert(lastComma, " and");