Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb.net Substring function 1

Status
Not open for further replies.

belle9

Programmer
Nov 3, 2004
87
US
I'm trying to get a filename without the extension. Any suggestions?
 
Try
sFilename = Path.GetFilenameWithoutExtension(sFilePath)

Yes it really is that simple



Bob Boffin
 
LOL! I worked it out this way:

Dim n
Dim o
n = newname.Length
o = (objFile.Extension.Length)
newname = newname.Substring(0, (n - o))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top