Discuss using and improving Lua and the Lua Player specific to the PSP.
Moderators: Shine , Insert_witty_name
the underminer
Posts: 123 Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands
Post
by the underminer » Tue Nov 08, 2005 4:21 am
Code: Select all
dot = string.find (contents[1], [[.]])
doesn't work. Neither does
Code: Select all
dot = string.find (contents[1], ".")
Does anyone know why this happens or how to do this?
Behold! The Underminer got hold of a PSP
MikeHaggar
Posts: 116 Joined: Mon Jul 18, 2005 2:20 am
Post
by MikeHaggar » Tue Nov 08, 2005 4:55 am
the underminer wrote: Code: Select all
dot = string.find (contents[1], [[.]])
doesn't work. Neither does
Code: Select all
dot = string.find (contents[1], ".")
Does anyone know why this happens or how to do this?
dot = string.find (contents, ".") ?
the underminer
Posts: 123 Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands
Post
by the underminer » Tue Nov 08, 2005 8:08 pm
no, contents is right. I'm trying to find "." in the array contents where i is the entry number. i = 1 So it reads from the first entry of contents. I'm not wrong there
Behold! The Underminer got hold of a PSP
Durante
Posts: 65 Joined: Sun Oct 02, 2005 6:07 am
Location: Austria
Post
by Durante » Wed Nov 09, 2005 1:54 am
Easy, by default find does pattern matching, so . matches any character.
Read more:
http://www.lua.org/pil/20.1.html
(I don't know how many threads I have answered with links to PIL already... just read it! - I didn't know Lua 3 weeks ago either ;))
Btw, what you want is "%."
the underminer
Posts: 123 Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands
Post
by the underminer » Wed Nov 09, 2005 7:31 am
I knew it was a stupid question, but didn't know where to get the answer. thanks a million durante!
Behold! The Underminer got hold of a PSP