How to replace characters in a string?

 Posted by Rajesh_Kumar on 1/20/2014 | Category: C# Interview questions | Views: 1498 | Points: 40
Answer:

With the help of Replace method we can repace any word from withing string value. It takes 2 parameters i.e. old_value and new_value.

For Example:-

string st_name = "Rajesh Sathua";

st_name = st_name.Replace("Rajesh", "Rajesh Kumar");


Output would be:Rajesh Kumar Sathua


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response