In Adobe Lightroom a Plug-in is written in Lua. In an attempt to teach myself Lua I am working myself through the SDK producing own Plug-ins. Now I came accross a situation where I am getting a string from a table named 'images' like this:
images[1] = "d:\Windows\Temp\LREXPORT\NK119542.tif"
But of course Lua does not like those unescaped backslashes at all. The content of this table varies depending on the user action. I am thinking of a solution to grab that string and manipulate it for further processing.
Correct strings would be:
newimages = "d:/Windows/Temp/LREXPORT/NK119542.tif"
newimages = "d:\\Windows\\Temp\\LREXPORT\\NK119542.tif"
Went through lots of posts and online tutorials but sorry, I was not able to figure this one out. Hope there is a solution, thanks for replies.
You can delimit your string with [[
and ]]
:
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> s = '\n'
> print(s)
> s = [[\n]]
> print(s)
\n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With