Solved

Replace a character with string

Posted on 2008-06-13
4
683 Views
Last Modified: 2012-08-13
How can I replace a char with a string like
str.Replace('&', 'and');
0
Comment
Question by:mpaturi1
4 Comments
 
LVL 16

Expert Comment

by:burakiewicz
Comment Utility
str.Replace("&","and")
0
 
LVL 31

Accepted Solution

by:
Frosty555 earned 20 total points
Comment Utility
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
 
LVL 13

Expert Comment

by:joechina
Comment Utility
str.Replace("&", "and");
0
 

Author Comment

by:mpaturi1
Comment Utility
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 72
I need C# converted to VB.net 1 52
Windows Service to Receive TCP Packets 4 27
COnsume rest client 6 4
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now