How To Replace Characters In A C# String
In my previous posts I have explained various topics like Disable Back Button in Browser using jquery, Jquery, asp.net, visual studio,C#.Net,Console application
Now in this post, I will explain How To Replace Characters In A C# String with appropriate example.
Open Visual studio and write below lines of C# code in it.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Single character replace example.");
string beforeReplace = "1@ 3@ 5@ 7@";
string afterReplace = beforeReplace.Replace('@','#');
Console.WriteLine(afterReplace);
Console.ReadLine();
}
}
OutPut : 1# 3# 5# 7#
Summary
You can also read about ASP.NET, C#.Net, JQUERY, AJAX, JavaScript
I hope you get an idea about How To Replace Characters In A C# String.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you liked this post, don’t forget to share this.