I’m trying to get a simple substring happening of everything after “…” but it’s throwing a runtime error saying that the output of string.find isn’t a number. When I hard code the number it works fine.
local k = “com.mywebsite.my_product.001…MIRROR”
local dotPos = string.find(k,"…",1,true)
print(k)
print(dotPos)
print(type(dotPos))
print(string.sub(k,dosPos))
This outputs…
com.mywebsite.my_product.001…MIRROR
25
number
Runtime error
…/Corona/screen1.lua:50: bad argument #2 to ‘sub’ (number expected, got nil)
I don’t understand what is going wrong here. If I hard code string.sub(k,25) then it works.
[import]uid: 51622 topic_id: 10305 reply_id: 310305[/import]