You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
491 B
C#

/*
* C# Program to Replace String in String
*/
using System;
class Program
{
static void Main()
{
const string s = "Sun Rises in the West";
Console.WriteLine("Sentence Before Replacing : {0} ",s);
string s1 = s.Replace("West", "East");
Console.WriteLine("Sentence After Replacing : {0} ",s1);
Console.ReadLine();
}
}
/*
Sentence Before Replacing : Sun Rises in the West
Sentence After Replacing : Sun Rises in the East