473,385 Members | 2,029 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,385 software developers and data experts.

Adding a " to a string

Hello,

I want to do concatenate two strings together and insert double quotes " in
between them. How do I do that. It doesn't like:

string1 & """ & String2

Thanks
Nov 20 '05 #1
3 11799
String1 = "ABC"
String2 = "DEF"

String1 & """" & String2 (result is ABC"DEF)

or

String1 & """""" & String2 (result is ABC""DEF)

"paul reed" <pr****@jacksonreed.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello,

I want to do concatenate two strings together and insert double quotes " in between them. How do I do that. It doesn't like:

string1 & """ & String2

Thanks

Nov 20 '05 #2
* "paul reed" <pr****@jacksonreed.com> scripsit:
I want to do concatenate two strings together and insert double quotes " in
between them. How do I do that. It doesn't like:

string1 & """ & String2


\\\
x = string1 & """" & string2
///

Instead of a single double quote you need to write 2 double quotes.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3
Did you tried this:

Dim test1 As String = "test1"
Dim test2 As String = "test2"
Console.WriteLine("The result is: " & test1 & """" & test2)

The result is: test1"test2

Hope that helps

"paul reed" <pr****@jacksonreed.com> wrote in message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
Hello,

I want to do concatenate two strings together and insert double quotes " in
between them. How do I do that. It doesn't like:

string1 & """ & String2

Thanks

Nov 20 '05 #4

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

Similar topics

1
by: David Furey | last post by:
Hi I have an XML documnet and a XSLT document as shown below THe XSLT document brings back a filtered docmument that has the VendorName that starts with a particular sub-string This works as...
8
by: Mark | last post by:
My PHP script builds a table that is too wide to fit on the paper. Two of the columns contain strings that are more lengthy than data in the other columns. I can get the table to fit by letting...
1
by: Guadala Harry | last post by:
The following function, SplitTheString(), splits a string based on a flag that is like this: {Flag1:whateverHere} Note that the "whateverHere" part can be any character - and at least one...
2
by: Mike Fiedler | last post by:
On a client web services request, I have a SoapExtension that is adding a header to the message in the BeforeSerialize stage. If the Web Service request is for an operation with...
1
by: R Fitzgerald | last post by:
Hi to all, I have a long list of emails in the form address@server.com, recipient's name, and I need to add < at the beginning and end of the address field. I never worked with file commands...
1
by: Jedufa | last post by:
following of thread: "Adding namespaces to code behind automatically" Hello, I had quite the same problem and got further in the right direction with your suggestions, thanks. Nevertheless, I...
9
by: Ben Bacarisse | last post by:
I am porting a program from the Windows world to the Linux world. The source uses MS's new "safer" string functions such as: strcat_s(dest, size, source); but there are also calls such as: ...
3
by: donllll | last post by:
Hello, I am coding an web service factory application. In service implementation code I am trying to pass a domain and user to a stored procedure on a SQL Server 2005 Database. The problem is I...
0
by: jonceramic | last post by:
Hi All, My apologies for asking something that I'm sure has been answered for. But, my google searching can't find a proper set of keywords. I would like to add "New..." or "other..." or...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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,...

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.