Replace char inside a string

image_pdfimage_print
   
 

using System;

public class TestStringsApp {
    public static void Main(string[] args) {
        string a = "strong";

        // Replace all 'o' with 'i'
        string b = a.Replace('o', 'i');
        Console.WriteLine(b);

        string c = b.Insert(3, "engthen");
        string d = c.ToUpper();
        Console.WriteLine(d);
    }
}

    


This entry was posted in Data Types. Bookmark the permalink.