Groups | Blog | Home
all groups > vb.net > november 2005 >

vb.net : Newbie String Q


Dennis
11/30/2005 4:11:03 PM
Something like:

dim fi as new fileinfo(path_filename)\
fname = fi.name
fextension = fi.extension


--
Dennis in Houston


[quoted text, click to view]
I Don't Like Spam
11/30/2005 7:16:16 PM
[quoted text, click to view]

use indexof and substring

Dim BackSlash as Integer= FullPath.LastIndexOf("\")
FileName = FullPath.Substring((BackSlash + 1), FullPath.Length -
Mike W
11/30/2005 11:56:39 PM
I have :a friend: who needs to extract a filename from a variable
path_filename.
The path/filename combo is stored in a string and is different each time.

Something like

strFile = txtPathFile.text 'were the txtPathFile textbox is populated with
c:\windows\win.com

what is the most straight forward way to pull win.com out and place into
another string like strFile?

I really appreciate...I mean, my friend really appreciates the help. ;-)

Thanks,
m

Herfried K. Wagner [MVP]
12/1/2005 1:11:57 AM
"Mike W" <thewittmer@yahoo.com> schrieb:
[quoted text, click to view]


\\\
Imports System.IO
..
..
..
Dim FileName As String = Path.GetFileName(Me.TextBoxPathFile.Text)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
AddThis Social Bookmark Button