Micro Focus QTP (UFT) Forums
concatenating " (double quote) in a string??? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: concatenating " (double quote) in a string??? (/Thread-concatenating-double-quote-in-a-string)



concatenating " (double quote) in a string??? - vijayendra.shukla - 06-13-2011

Hi,

How can I concatenate a string variable with " (double quote)??

For example:

strValue1 = "The link is "

Now I want this string to be" "The link is "Click Me"."

for that I would want "Click Me". to be appended to the strValue1 string.

How do I do that with QTP? Is it even possible to have " in your string?

Thank you!

Moderator Note: Here are the Two ways to Escape (or Concatenate) a double quote in VBScript 


RE: concatenating " (double quote) in a string??? - byzoor - 06-13-2011

Hi,

Code:
strValue1 = "The link is "
strNewvalue=strValue1 & chr(13) &"Click Me"&d Chr(13)
msgbox strNewvalue


Happy Tester,
Byzoor,


RE: concatenating " (double quote) in a string??? - vijayendra.shukla - 06-13-2011

Oh yeah. It didnt strike meSad. Thanks.

Just a minor correction though... it should be chr(34) for double quote.


RE: concatenating " (double quote) in a string??? - rajpes - 07-05-2011

And another way of suppressing double quote's qtp meaning is by adding an additional double quote
strValue1 = "The link is ""Click Me"" "