Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Replace a character with string

Posted on 2008-06-13
4
Medium Priority
?
693 Views
Last Modified: 2012-08-13
How can I replace a char with a string like
str.Replace('&', 'and');
0
Comment
Question by:mpaturi1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Expert Comment

by:burakiewicz
ID: 21782120
str.Replace("&","and")
0
 
LVL 31

Accepted Solution

by:
Frosty555 earned 80 total points
ID: 21782141
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
ID: 21782271
str.Replace("&", "and");
0
 

Author Comment

by:mpaturi1
ID: 21852096
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

636 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