Micro Focus QTP (UFT) Forums
diff betwn "&" and "+" for cancatenation - 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: diff betwn "&" and "+" for cancatenation (/Thread-diff-betwn-and-for-cancatenation)



diff betwn "&" and "+" for cancatenation - learner1 - 12-16-2009

do these both character ("&" and "+" ) serve the same pupose of concatenation

i tried concatenation of 2 strings using both above chars it was workin fine then wat could be the differences


RE: diff betwn "&" and "+" for cancatenation - Ankur - 12-16-2009

Both can do the string concatenation, while + can also be used to add numeric values.
Just to eliminate confusion, try to use "&" when concatenating two strings.


RE: diff betwn "&" and "+" for cancatenation - learner1 - 12-16-2009

thanks for the reply

to add a note :

In case of "+"
if both are numeric then it will add
if both are string then it will concatenate
if numeric +string then type mismatch

In case of "&"
if both are numeric then it will concatenate
if both are string then it will concatenate
if numeric +string then also concatenate
HERE ALL ARE Cases have concatenation