How to replace a string in C# ?

By | April 17, 2011

Want to know how to replace a string in C#? See the following code.

using System;

class MainClass {
  public static void Main() {
    string testStr= "Coderz";

    testStr= testStr.Replace("erz", "ings");


Guess output?


Leave a Reply

Your email address will not be published. Required fields are marked *