|
-
September 10th, 2010, 11:37 AM
#1
Dumb Question: String dividing.
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
-
September 10th, 2010, 12:37 PM
#2
Re: Dumb Question: String dividing.
How about?
Code:
FilenameObject.Extension
-
September 10th, 2010, 12:49 PM
#3
Re: Dumb Question: String dividing.
yep
You could also use .Split() using \ as the seperator and look at the last element of the resulting array but the method above would be a better choice. Just throwing this in so that you know it is an option.
Always use [code][/code] tags when posting code.
-
September 10th, 2010, 01:05 PM
#4
Re: Dumb Question: String dividing.
Thanks a ton, guys! Sorry for it being such a dumb question, but like I said, I'm learning :P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|