programming-examples/c-sharp/Strings/C# Program to Replace String in String.cs

19 lines
491 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* 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