If you think you’ll be doing a lot of this, just create a utility library and include a function in it like the one below:

function string.getBaseName(path)
   local pathDelim = '\\'
   if os.getenv('OS') ~= 'Windows_NT' then
      pathDelim = '/'
   end
   local pathList = path:split(pathDelim)
   return pathList[#pathList]
end

‘require’ the library and you’ll then be able to invoke it just like any other string function:

require 'mhutils'
...

   local baseName = path:getBaseName()

Jeff Drumm ◊ VP and COO ◊ HICG, LLC. ◊ http://www.hicgrp.com