It looks like there may be a bug in function (StrTrimLeft) which I'm using to separate the file name extension from the remaining part of the file name. For whatever it is worth the files I'm working with are images and a typical extension is .jpg. I'm using the StrRFind function to locate the right most period (".") in the filename. Then StrSub to obtain the portion of the filename that includes everything up to the period. This all works as expected.
However, when I then use StrTrimLeft to obtain just the file name extension I get different results depending on how the filename is composed. In my case, whenever the filename has only one period (".") that separates the extension from the rest of the filename I get the expected result. For example, if the filename is "PartA.jpg" I get the extension as ".jpg". However, if the file name where "PartA.PartB.jpg" I get the extension as "jpg". In that, an extra period (".") character is being trimmed. The same, incorrect result, seems to occur whenever the filename contains more than one period (".").
Following are a couple of lines of code that experience the problem -
@var $linkname = StrSub($filename, 0, StrRFind($filename, "."));
@var $linkext = StrTrimLeft($filename, $linkname);