Replace one character from another character in CSharp
Description
The following code shows how to replace one character from another character.
Example
//from w ww .ja v a2 s . co m
using System;
class MainClass {
public static void Main() {
string[] myStrings = {"To", "be", "or", "not","to", "be, java2s.com"};
string myString = String.Join(".", myStrings);
string myString12 = myString.Replace(',', '?');
Console.WriteLine(myString12);
}
}
The code above generates the following result.