Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Left() Right() and Lua
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Gore
(207 posts) Bio
|
Date
| Mon 29 Jan 2007 05:15 PM (UTC) |
Message
| I've tried looking through the Lua documentation for equivelents of VBScript's Left() and Right(), but I can't seem to find them.
Is string.gsub() all I have to work with? | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Mon 29 Jan 2007 06:30 PM (UTC) |
Message
| You might want to check string.sub . It does both of them at once.
string.sub(s, 1, 5) gets the first 5 characters.
string.sub(s, -5) gets the last 5 characters.
See:
http://www.lua.org/manual/5.1/manual.html#pdf-string.sub |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
15,300 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top