Hi all.
I am trying to do the following, and failing.
I have a string for example:
local animal = “sheep”
And I want to change this to
local animal = " ‘sheep’ "
Is there anyway I can do this with Lua? I was thinking with GSUB but cannot get my head around it.
If you can’t see the different, the 2nd line has an extra ’ on either side of sheep.
Fixed it in a hacky way - Any other suggestions?
local animal1 = “’”
local animal2 = “sheep”
local animal3 = animal1…animal2…animal1
Try the following:
local animal = "sheep" local new\_animal = "'"..animal.."'"
Or did I get you wrong and you want something different?
Cheers, that’s what I ended up doing. I was over-complicating it for myself I think.
Fixed it in a hacky way - Any other suggestions?
local animal1 = “’”
local animal2 = “sheep”
local animal3 = animal1…animal2…animal1
Try the following:
local animal = "sheep" local new\_animal = "'"..animal.."'"
Or did I get you wrong and you want something different?
Cheers, that’s what I ended up doing. I was over-complicating it for myself I think.