Thread
:
Problem with local variable (it is NIL all of sudden)?
View Single Post
02/01/15, 05:13 AM
#
7
merlight
Join Date: Jul 2014
Posts: 671
Two small tips:
1) to strip N characters from the end, you can use negative end index:
Lua Code:
s
=
s:sub
(
1
, -
1
-N
)
2) to strip all digits from the end, you can use pattern replacement:
Lua Code:
s
=
s:
gsub
(
"%d+$"
,
""
)
edit: fixed calls, guess my Lua is waning
Last edited by merlight : 02/01/15 at
05:19 AM
.
merlight
View Public Profile
Send a private message to merlight
Find More Posts by merlight