Replacing substring

Replace method from string type replaces the found substring with specified string.


using System;

class Sample
{
    public static void Main()
    {
        string s = "java2s.com";

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

        Console.WriteLine(s);

    }
}

The output:


JAVA2s.com
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.