Sep 28, 2009, 11:00 AM
Post #1 of 8
I have a string that represents the full path for a file, ie, something like,
string operation to get the file name
There is an unknown level of sub folders, and I'm trying to substring out only the file name portion of the string. (without the .txt or whatever extention I may find)
I see this as a two part substring, once to cut out the path, and again to cut out the file extension. But if I were to work with the string as-is, I think I need to use regular expressions, since I don't know how deep the subfolders are... I need to somehow pick out the position of the last "\".
But, if I can somehow reverse the original string, then I can think of an easy way to do this... first cut out the file extension by looking for the first ".", then cut out the path by looking for the first "\" and re-reverse the result... But I don't see a reverse function for a string.
Hopefully, you followed what I said.
EDIT: or is there a way to glob without getting the entire path? That would avoid having to do the above.
(This post was edited by DoolinDalton on Sep 28, 2009, 11:06 AM)