String Replace Function in C#
The following code will replace a character or a word with some other character or a word. This is accomplished by the replace function in C#.
using System;
using System.Text.RegularExpressions;
string strReplace;
strReplace = "This is a test string.";
strReplace = Regex.Replace(strReplace, " is", " was");
Related Articles
- Rename a File on the Disk or Local File System using C#
- Try Catch Statements for Error Handling in Asp.Net & C#
- Send Email Attachments from a Form using Asp.Net and C#
- Create a Checkbox List Web Control Using Asp.Net & C#
- VBA Code to Call Windows API File Open Dialog Box in Microsoft Access
- Obtain Values of Query String using C#
- Prevent Framing of your Website using Html
- How to Fix the Background Image on a Webpage using Html
