Add double quote in a string - Need explanation

Hi Friends,

Can anyone explain me the logic behind typing the string in double quotes.

used a in assign activity and given this value “”“UiPath”“” and it is printed as “UiPath”

Next i used in the right side of assign activity as “”“Automation tool = ““UiPath””” it prints as "Automation tool =“UiPath”

If double quotes prints if 3 set of double quote used then how double quote(") is printed before UiPath

Can someone clearly explain this.

I am aware the escape sequence syntax in .net “backsl"UiPathbacksl"”

Thanks,
Ula

The outer " on either string are the start and end of the string.
So for “”“UiPath”“” you have:
" - start of String
“” - Escaped double quote
UiPath
“” - Escaped double quote
" - end of string

And for “”“Automation tool = ““UiPath””” you have:
" - start of string
“” - escaped double quote
Automation tool =
“” - escaped double quote
UiPath
“” - escaped double quote
" - end of string

2 Likes

I tend to use Chr(34) instead of double quotes because it is easier to read (for me) then trying to figure out how many double quotes in a row there are in a string. So if you wanted the string to be (including quotes) “UiPath” you could do Chr(34) + "UiPath" + Chr(34) or you could do """UiPath"""

4 Likes

@DanielMitchell Thank you. Got it.

1 Like

Hi @Dave Thank you. I was not aware of Chr(34) learnt a new thing today. Thanks.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.