How do you trim a string
How do you trim a string
How do you trim a string
How do you trim a string
How do you trim a string
How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string
How do you trim a string How do you trim a string
How do you trim a string
Go Back  Xtreme Visual Basic Talk > > > How do you trim a string


Reply
 
Thread Tools Display Modes
  #1  
Old 10-19-2005, 12:25 PM
death_entry's Avatar
death_entry death_entry is offline
Centurion
 
Join Date: Mar 2005
Posts: 167
Default How do you trim a string


Say if I had the following string

"C:\Music\Gorillaz - Demon Days [2005]\06 - Feel Good Inc..mp3"

How would I make the value be

"06 - Feel Good Inc."

Basically I want to be left with the filename and have the path and the file extension removed.
Reply With Quote
  #2  
Old 10-19-2005, 12:27 PM
Allen G's Avatar
Allen G Allen G is offline
Centurion
 
Join Date: Jul 2004
Location: Arlington, Texas
Posts: 189
Default

Quote:
Originally Posted by death_entry
Say if I had the following string

"C:\Music\Gorillaz - Demon Days [2005]\06 - Feel Good Inc..mp3"

How would I make the value be

"06 - Feel Good Inc."

Basically I want to be left with the filename and have the path and the file extension removed.
use System.IO.Path.GetFileNameWithoutExtension
Code:
Dim path As String = "C:\Music\Gorillaz - Demon Days [2005]\06 - Feel Good Inc..mp3"
Dim fileName As String = System.IO.Path.GetFileNameWithoutExtension(path)
fileName would now = "06 - Feel Good Inc."

Last edited by Allen G; 10-19-2005 at 12:33 PM.
Reply With Quote
  #3  
Old 10-19-2005, 12:47 PM
death_entry's Avatar
death_entry death_entry is offline
Centurion
 
Join Date: Mar 2005
Posts: 167
Default

Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How do you trim a string
How do you trim a string
How do you trim a string How do you trim a string
How do you trim a string
How do you trim a string
How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string How do you trim a string
How do you trim a string
How do you trim a string
 
How do you trim a string
How do you trim a string
 
-->