Okay, I have a file name + directory as a string. What I'm trying to do is separate the file name (with or without) an extension from the rest of the directory. The point is that it is supposed to be a dynamic file location and the file extension is NOT limited to 3 characters. What would the best way to approach this be?

P.S. Kinda dumb question, I know, but I'm trying to learn. Any pointers or examples would be greatly appreciated