View Single Post
02/01/15, 05:13 AM   #7
merlight
AddOn Author - Click to view addons
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:
  1. s = s:sub(1, -1-N)

2) to strip all digits from the end, you can use pattern replacement:
Lua Code:
  1. s = s:gsub("%d+$", "")

edit: fixed calls, guess my Lua is waning

Last edited by merlight : 02/01/15 at 05:19 AM.
  Reply With Quote