pos = string.find("1.23x", ".")
print ( pos )
I always get 1, when the output should be 2. Even if I try this
pos = string.find("123x", ".")
print ( pos )
It still returns 1.
What am I doing wrong?
pos = string.find("1.23x", ".")
print ( pos )
I always get 1, when the output should be 2. Even if I try this
pos = string.find("123x", ".")
print ( pos )
It still returns 1.
What am I doing wrong?
Forgot that Lua can use patterns, this works:
pos = string.find('1.23x', '.',1 ,true)
print ( pos )
The dot was matched as a pattern, the fourth argument sets the mode to plain, so it recognises the dot as a regular character.