473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to concatenate a string whit "

Hi,
I have this problem:
In C# i have to concatenate a string "hi Carl" with
another string like this """, but C# gives me an error.
How can i concatenate a string with the " character?

Thank you
Alessandro Rossi
Nov 15 '05 #1
2 3137
Use an Escape Character before the quotation mark. The escape character is a
backslash '\'.

Example:

string str = "\"Hi Carl\"";

-Darrin
"Alessandro Rossi" <al**************@areaitsrl.com> wrote in message
news:09****************************@phx.gbl...
Hi,
I have this problem:
In C# i have to concatenate a string "hi Carl" with
another string like this """, but C# gives me an error.
How can i concatenate a string with the " character?

Thank you
Alessandro Rossi

Nov 15 '05 #2
Alessandro Rossi wrote:
Hi,
I have this problem:
In C# i have to concatenate a string "hi Carl" with
another string like this """, but C# gives me an error.
How can i concatenate a string with the " character?

Thank you
Alessandro Rossi


In the middle of a string, use the escape character, \, followed by a "
to add a " to the string.

E.g.

String FOOBAR = "\" To defend everything is to defend nothing \" -
Alexander the great";

Would be become: "To defend everything is to defend nothing" - Alexander
the great

Simon.

Nov 15 '05 #3

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

Similar topics

1
1596
by: Admir Hod?ic via AccessMonster.com | last post by:
I use some old fashion program whit DBF files and now i step by step moving thth to acces. Problem occurs when i try to link DBF tables whit MEMO FILED wich requvest file whit ''name''.ftp extension...
3
4203
by: PC Datasheet | last post by:
I have three lines of text I need to concatenate into one "paragraph". The "paragraph" need to look like: Text1 Text2 Text3 where the lines of text are stacked in the "paragraph". When I use...
13
2342
by: jt | last post by:
I can't seem to find a way to concatenate strings that have nulls within the string. I have a string that I need another string that has nulls in it and what to append the 2nd string, 3 string...
3
8789
by: Tom | last post by:
Hi I want to retrieve database data and concatenate them to a string. Here is my code .ToString()); //runtime error her } while (dr.NextResult()) string array =...
1
1961
by: news.wanadoo.nl | last post by:
Hi, I have found whit google this form in this group. But i'n not good in javascript :(. I try and error normal but i only error now :P Whit i now want to now how can i get access to the vars...
5
2794
by: Generic Usenet Account | last post by:
I have been to recreate a problem that I am having with strings with the trivial code snippet given below. In the trivial code example, I am reading five lines from a data file, each line having...
14
27153
by: metamorphiq | last post by:
Hello, I'm a Java programmer, so I'm probably asking a very simple question here, but I have trouble solving it :) I'd like to know how you concatenate multiple (4, in my case) char* in C++,...
13
21782
by: sinbad | last post by:
hi, how to concatenate a "hash defined" constant value to another "hash defined" constant string. For example #define ABC 100 #define MYSTR "The value of ABC is" Now i need a string that...
10
7418
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6982
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
5572
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,...
1
5000
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
4667
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
3161
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
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
374
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.