954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

string manipulations

string path =c:/document/abc.doc
this is my input string
i want the output only abc not .doc
can any one tell me the code for this plz

sivak
Junior Poster
132 posts since Nov 2008
Reputation Points: 3
Solved Threads: 0
 

use split function

string output=path.Split('.');
Poojasrivastava
Newbie Poster
13 posts since Apr 2009
Reputation Points: 11
Solved Threads: 0
 

If your question is regarding to file path and you want to get the name of file not an extension then use System.IO.Path.System.IO.Path.GetFileNameWithoutExtension(path).

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You