'String value within a string value
As stated above is the thing I am attempting to accomplish. I am using Pilot.Lua
local a = "I am a text"
local textbox = ({value="local a = "I am a text""})
Problem here is that if I was to transfer this sample code into "textbox" I would receive an error due to the "I am a text" being read as code rather than a string value. Is there any way around this?
Solution 1:[1]
Use single quotes
local textbox = ({value='local a = "I am a text"'})
or long strings:
local textbox = ({value=[[local a = "I am a text"]]})
Solution 2:[2]
You need to escape the quotation marks with backslashes
local a = "I am a text"
local textbox = ({value="local a = \"I am a text\""})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lhf |
| Solution 2 | thpbaxxter |
