473,508 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Question..

Hi Guys,

Just wondering how we can build up a string which needs to contain speech
mark symbols in the text itself. For example doing something like..

exampleString = "Join the "2" groups together"

I am not sure how to do that in C#. Currently I can only able to acheive
something like this as a short hand..

exampleString = "Join the '2' groups together"

by using single quotes which I do not need..

Looking for valuable feedback on this simple query.

Thanks.

Irfan
Nov 16 '05 #1
2 928
Use backslash for escape chars:
exampleString = "Join the \"2\" groups together";

ok,
aq

"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
Hi Guys,

Just wondering how we can build up a string which needs to contain speech
mark symbols in the text itself. For example doing something like..

exampleString = "Join the "2" groups together"

I am not sure how to do that in C#. Currently I can only able to acheive
something like this as a short hand..

exampleString = "Join the '2' groups together"

by using single quotes which I do not need..

Looking for valuable feedback on this simple query.

Thanks.

Irfan

Nov 16 '05 #2
Hi Irfan,

In addition to what Ahmed said you can also use a verbatim string. Just
prepend an @ symbol before the double quotes when beginning a string. If you
are using double quotes in the string you will need to escape them by
doubling them up. For instance:

string x = @"Hello ""World"" symbols : \ ^&* ";

I hope this helps.
----------------------

Nov 16 '05 #3

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

Similar topics

7
2265
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
14
2961
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
30
3472
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
17
5788
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
1
3711
by: liming | last post by:
I have installed postgresql 8.3.1,import data from a dB to another one.I work in pgadmin 3 . When I choose a table ,select the characteristic?it shows the problem below? Error:relation...
0
7326
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,...
1
7046
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
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.