472,980 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,980 software developers and data experts.

How to replace " with " character in String

6
Suppose I have the following string whch is part of an xml string:
String s= "Script Id="Test" "

And I need to get
s= "Script Id="Test" "

Can anyone tell me how this can acheived?

Thanks,
jmash
Feb 13 '08 #1
2 36910
Shashi Sadasivan
1,435 Expert 1GB
Have you tried the Replace?

String s= "Script Id="Test" ";
s = s.Replace(""", "\"");

backslash is used as an escape character.
Note the 3 quotation marks in the second argument of the Replace method
Feb 13 '08 #2
DrBunchman
979 Expert 512MB
Suppose I have the following string whch is part of an xml string:
String s= "Script Id="Test" "

And I need to get
s= "Script Id="Test" "

Can anyone tell me how this can acheived?

Thanks,
jmash
No problem JMash,

To insert a double quotation inside a string you need to use two double double quotation marks next to each other. So you would replace all instances of &quot with "". Try this:

s = s.Replace("&quot", """")

This little rule about quote marks applies to apostrophe's as well where they are used as string delimiters (for example in SQL) and is an important thing to be aware of.

Give this a try and let me know if it helps,

Dr B
Feb 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: ajikoe | last post by:
Hello, I would like to replace string with different values, For example : source = 'kode1 bla bla kode1 bla kode1' I have a list with each member will replace each of kode1. L = So the new...
4
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
1
by: Neil Zanella | last post by:
Hello, The MSDN documentation does not seem to mention whether the Replace string method returns a new string or modifies the existing string in place and then returns it. I would like to know...
2
by: Dmitriy Kolesnik | last post by:
Hello, all! I don't know how I can replace specified string in the txt-file from one to another. Thank You. -- __________________
5
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
11
by: BenI | last post by:
Hello, I have a XML file using Iso 8859-1 encoding. Every time when I try to put & character as Tag's value like <tag>This is & character</tag> Exception is shown in my application. I use...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
3
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.