Quantcast
Channel: w3courses.com - C#
Viewing all articles
Browse latest Browse all 6

String Replace Function in C#

$
0
0

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");


Viewing all articles
Browse latest Browse all 6

Trending Articles