Replace a character with string

How can I replace a char with a string like
str.Replace('&', 'and');
mpaturi1Asked:
Who is Participating?
 
Frosty555Commented:
Seems to me like you've pretty much written the code out already?
string MainString "String Manipulatin"; 
string CorrectString = MainString.Replace("Manipulatin", "Manipulation"); 
//SHOW CORRECT STRING 
MessageBox.Show("Correct string is : " + CorrectString); 

Open in new window

0
 
burakiewiczCommented:
str.Replace("&","and")
0
 
joechinaCommented:
str.Replace("&", "and");
0
 
mpaturi1Author Commented:
I was missing the left hand side of the str.Replace("&","and");
after making change to the code as

str mystring = str.Replace("&", "and");

It was fine.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.