Answers for "c# list to string replace last comma with and"

C#
0

c# list to string replace last comma with and

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");
Posted by: Guest on July-22-2020
0

c# list to string replace last comma with and

string.Length = string.Length - 2;
Posted by: Guest on September-07-2021

Code answers related to "c# list to string replace last comma with and"

C# Answers by Framework

Browse Popular Code Answers by Language