I have a type string first part;second part. I want to break it into ;and return the second part. Everything works perfectly:
start = mystring:find(';')
result = mystring:sub(start)
But I was hoping to do this on one line:
result = mystring:sub(mystring:find(';'))
It does not throw an error, but does not return the expected result. Not a big problem, since it works fine on two lines of code, but understanding why it doesn't work on oneliner will help me better understand how lua works.
ripat source
share