Home > Code > C# > Replace the character in the given string using C#

Replace the character in the given string using C#

by Narain Siddharth   on Nov 13, 2010   Category: C#   |  Views: 947    |  Points: 25   |  Silver 



class Program
{
static void Main(string[] args)
{
string strTest = "DotNetGallery";
// Replace all 'y' with 'i'
string strResult = strTest.Replace('y', 'i');
Console.WriteLine(strResult);
Console.ReadKey();
}
}


Above C# code snippet used to replace character in the given string.


Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts