|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Stripping just the filenameI have a string that contains both the filename and the directory. Something
like "c:\temp\test.txt". I need a process that will take this string and return only the file portion "text.txt". How might I do this. Kept in mind sometimes the string may contain "C:/temp/test.txt". Any ideas? Greg,
You can use the System.IO.Path class. For example: MsgBox(System.IO.Path.GetFileName("C:/temp/test.txt")) Kerry Moorman Show quoteHide quote "Greg Larsen" wrote: > I have a string that contains both the filename and the directory. Something > like "c:\temp\test.txt". I need a process that will take this string and > return only the file portion "text.txt". How might I do this. Kept in mind > sometimes the string may contain "C:/temp/test.txt". Any ideas? This is definitely superior than parsing the string to extract the filename,
which I have been doing to do things like this. Cyril Gupta
Porting VB6 to .Net - DDE replacement?
Binding currencyManager and dataRelation - datagridview - possible Problem loading XML Object from variable Need help with Conversion from C# to VB.net Application.Exit text align Inline SQL vs stored procs on SQL Server 7 and 2000 Alternate Name Looping through Dataset |
|||||||||||||||||||||||