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.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var