the chunks:
"You say \"" // Outputs: You say "
+ text + // Outputs (example): hello // You say "hello
",\" but nobody replies." // Outputs: ," but nobody replies. // You say "hello," but nobody replies.
"You say \"" + text + ",\" but nobody replies."
// outputs: You say "hello," but nobody replies.
PapiDimmi wrote:Hello!
I want to use this expression as shown in one of the official tutorials, but I want to move the comma.
This works great: "You say \"" + text + "\", but nobody replies."
The problem is that I want to remove the comma before "but" so it is placed within the quotes, but I can't do it.
I always get an error when trying to put the comma within the quotes.
Please help!
The Pixie wrote:"PapiDimmi"
Hello!
I want to use this expression as shown in one of the official tutorials, but I want to move the comma.
This works great: "You say \"" + text + "\", but nobody replies."
The problem is that I want to remove the comma before "but" so it is placed within the quotes, but I can't do it.
I always get an error when trying to put the comma within the quotes.
Please help!
Try this:
"You say \"" + text + ",\" but nobody replies."
What you have is three chunks of a string:
You say \"
text
,\" but nobody replies.
... which are added together with the plus sign. The first are last are "literal" strings, which means they are what they are, the middle is, of course a variable. The literal strings have to have double quotes at the start and end to tell Quest what they are. That means you need something else to have a double quote appear in the text.
The bit \" does that. That means you need to keep the \ and the " together; together they mean show a double quote. Therefore, you need to moe the comma before them, but after the first " of that chunk.
HegemonKhan wrote:the chunks:
"You say \"" // Outputs: You say "
+ text + // Outputs (example): hello // You say "hello
",\" but nobody replies." // Outputs: ," but nobody replies. // You say "hello," but nobody replies.
"You say \"" + text + ",\" but nobody replies."
// outputs: You say "hello," but nobody replies.
XanMag wrote:Just throwing this out there... I asked the grammar Nazi at school how to punctuation that sentence... She said it should be:
You say, "Hello", but no one replies.
Not sure if that is correct but I'd be surprised if it isn't (or at least an acceptable alternative).
XanMag wrote:Haha.
If it were my game I probably would have written it as: You speak but no one gives a damn enough to answer. Go figure.
But I'm a smart ass like that.
Father thyme wrote:Having said that I have difficulty with commas.