473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

double quotations

Ant
Hi, how do you output a string that will be seen with double quotatios?

I'd like to display:

This is my "Value".

by doing something like:

string op = "This is my " + " + txtbox.text.ToString() + ";
Any clues would be gratefully accepted.

Ant
Feb 2 '06 #1
3 1440
Ant wrote:
Hi, how do you output a string that will be seen with double quotatios?

I'd like to display:

This is my "Value".

by doing something like:

string op = "This is my " + " + txtbox.text.ToString() + ";
Any clues would be gratefully accepted.


You need to escape the quotes:

string op = "This is my \"" + txtbox.Text + "\".";

To make things more obvious, here is something in the middle of a
string:

string x = "This gives a \"quoted\" example.";

See http://www.pobox.com/~skeet/csharp/strings.html for more
information.

Jon

Feb 2 '06 #2
string op = "This is my \"" + txtbox.text.ToString() + "\"";

i.e. \" is the escape character for " - read up on "string escape
characters" for more info

Marc
Feb 2 '06 #3
Should also be pointed out for completeness that verbatim string literals
(prefixed with @) need "" to represent a single double quote rather than an
escape.

string x = @"This gives a ""quoted"" example.";

"Ant" <An*@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Hi, how do you output a string that will be seen with double quotatios?

I'd like to display:

This is my "Value".

by doing something like:

string op = "This is my " + " + txtbox.text.ToString() + ";
Any clues would be gratefully accepted.

Ant

Feb 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sydex | last post by:
When I compile code I get error C2664: 'Integration::qgaus' : cannot convert parameter 1 from 'double (double)' to 'double (__cdecl *)(double)' in this part : double Integration::quad2d(double...
6
by: Kondapanaidu | last post by:
Hi, I am using C#V1.1. How to add double quotations to a string. If I go with "\"" the back slash is going to be added to the assigned string. EX: string str="naidu" + "\"" + "GK" + "\"";
55
by: Martin Jørgensen | last post by:
Hi, I found the code below from http://www.blitzbasic.com/Community/posts.php?topic=55633 ------ ' Check if number is finite. Local u:Double = 2 ' also works for floats
67
by: lcw1964 | last post by:
This may be in the category of bush-league rudimentary, but I am quite perplexed on this and diligent Googling has not provided me with a clear straight answer--perhaps I don't know how to ask the...
3
by: devecibasi | last post by:
Hi, I am trying to use ShellExecute function to invoke the ax program. The code below works perfect: ShellExecute(0&, "open", "ax.exe", "C:\2runtemp2.run", "C:\axfolder", 5) The code below...
6
by: jeff | last post by:
Hello, e a sub I have created a database for my department, which will display all the users details (name etc), PC details, and software details. The database is just going to be a way of...
4
by: bmerlover | last post by:
Hi, I need to read a script file and change the text on the buttons I set. I have the psuedocode in my head, but I'm having trouble putting that into code. I figured out how to seperate B1 from T1...
1
by: bmerlover | last post by:
I'm having trouble reading quotations inside the richTextBox when a file is opened on to it. I've tried a couple different methods, most of them didn't compile. I came across one that does compile...
2
by: nargish | last post by:
I am eager to replace double quotations in the output that is being displayed. input text : This is "within quotes" output text: This is <p class="quotes">within quotes</p> I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.