|
| 31 Jan 2016 01:03 AM |
| I'm writing a script that displays text in a GUI, it would be useful to add " to it but that would simply close my string. |
|
|
| Report Abuse |
|
|
larr1212
|
  |
| Joined: 06 Jan 2015 |
| Total Posts: 259 |
|
| |
|
Aethex
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 2193 |
|
|
| 31 Jan 2016 01:06 AM |
You could use single quotes to define your string instead of double quotes.
i.e. str = 'this is a " string " yeah?' would output: this is a " string " yeah? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 31 Jan 2016 04:33 AM |
local validStrings = { "\"Hello world.\""; '"Hello world."'; [["Hello world."]]; "\34Hello world.\34"; (string.char(34) .. "Hello world." .. string.char(34)); }
for _, x in next, (validStrings) do print(x) end --[[> "Hello world." "Hello world." "Hello world." "Hello world." "Hello world."]] |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 31 Jan 2016 04:59 AM |
you forgot string.format("%q","Hello world.") |
|
|
| Report Abuse |
|
|
Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
|
| 31 Jan 2016 05:00 AM |
| I always use double metal brackets [["Hello world."]] |
|
|
| Report Abuse |
|
|