Javatpoint Logo
Javatpoint Logo

C# String Replace()

The C# Replace() method is used to get a new string in which all occurrences of a specified Unicode character in this string are replaced with another specified Unicode character.

There are two methods of Replace() method. You can replace string also.

Signature

Parameter

first: it is a first parameter of char type.

second: it is a second parameter of char type.

Return

It returns a string.


C# String Replace() Method Example

Output:

Hello C#

C# String Replace() Method Example 2

Output:

Cheers C#, Cheers .Net, Cheers Javatpoint
Next TopicC# String Split()





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA