Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Replace a character with string

Posted on 2008-06-13
4
Medium Priority
?
694 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
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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

810 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