Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question concerning quotes

Status
Not open for further replies.
Mar 28, 2002
4
US
Is it possible to concactenate two strings and then wrap the new string with quotes?
Ex.
string1 = "Today is"
string2 = "Friday"
string3 = string1 & string2
and then take the text in string 3 and wrap it in quotes so that the output from string 3 is "Today is Friday"

I swear I seen it before, and I've been racking my brains trying to figure it out. If anyone can give me a hand I'd appreciate it.
 
There are a couple of ways you could do this:

'use the " to make the quote in html
string3 = """ & string1 & string2 & """

'use the "
string3 = """" & string1 & string2 & """"
 
Sorry about the last post... it replaced the & q u o t ; on me. (so use the & q u o t ; without the spaces!

'use the & q u o t ; to make the quote in html
string3 = "& q u o t ; " & string1 & string2 & "& q u o t ; "

'use the "
string3 = """" & string1 & string2 & """"
 
Maybe I should have explained my situation a little better. I'm using vbscript to automate entries into Active Directory thru ADSI. Because of this, I'm not sure that "&q u o t" would work. Basically I'm making the script, saving it as a .vbs file, and then running it using wscript.exe. Any suggestions?
 
Did the second suggestion work?

'use the "
string3 = """" & string1 & string2 & """"
 
Also look at using Chr(34), so that Chr(34) & "Today is Friday" & Chr(34) should give

"This is Friday"

A.C.
 
Well I found out all along that it had nothing to do with wrapping the string in quotes, and that my error had to do with two commas not being present where they should have been... oh well. Thank for your help anyways
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top