Jump to content

quick question about quotation marks


d0n
 Share

Recommended Posts

Put double quotes around the entire string, double-double quote anywhere you want a double quote to appear within the string.

$string = " Jim said ""This is his' house"" "

MsgBox(0, "", $string)

Alternatively put single quotes around the entire string then double-single quote anywhere you want single quotes to appear within the string:

$string = ' Jim said "This is his'' house" '

Full explanation on this page: http://www.autoitscript.com/autoit3/docs/intro/lang_datatypes.htm

Edited by MrMitchell
Link to comment
Share on other sites

As an alternative: you can also introduce the the double quotation marks as ascii codes.

$string = "$string = "&Chr(34)&" Jim said "&Chr(34)&Chr(34)&"This is his' house"&Chr(34)&Chr(34)&Chr(34)
MsgBox(0, "", $string)

I sometimes do this if I want to introduce characters, into my code, which normally form part of (or may interfere with) autoit syntax: I also find it easier to visualize in certain situations. Although it is probably less efficient here, I find I am less likely to make mistakes when using this method.

Edited by czardas
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...