How to replace comma (,) with semicolon (;) in a string with C#

1 Answer

0 votes
using System;
 
class ReplaceCommaWithSemicolonInAString_CSharp
{
    static void Main(string[] args)
    {
        var s = "c#,c,c++,java";

        s = s.Replace(",", ";");

        Console.WriteLine(s);
    }
}
 
 
/*
run:
     
c#;c;c++;java
 
*/

 



answered Jul 12, 2017 by avibootz
edited Sep 6, 2024 by avibootz

Related questions

1 answer 145 views
1 answer 138 views
1 answer 150 views
1 answer 153 views
2 answers 183 views
1 answer 143 views
1 answer 141 views
...