function getFileExt
Whilst working on a small project I needed a function to get file extension so i've written a quick small function, i thought i'd share it in case someone else needs it for now, i will probably add this to the library for the next release.
function getFileExt(char* path) {
eax = path;
while (char[eax] != 0) {
eax++;
}
while (char[eax] != ord('.')) {
eax--;
}
eax++;
}
the usage is pretty simple, the function will take the string input find the .ext and return a pointer to the string with the offset, so bare in mind it still is pointing to the string you pass.
const myPath = 'C:/some folder/another folder/file.exe';
eax = getFileExt(myPath);
println(eax);
output:
exe
this can and will be improved when i see the need to or unless someone else beats me to it :P :)