943,772 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 375
  • C# RSS
May 20th, 2009
0

string manipulations

Expand Post »
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
Similar Threads
Reputation Points: 3
Solved Threads: 0
Junior Poster
sivak is offline Offline
132 posts
since Nov 2008
May 21st, 2009
0

Re: string manipulations

use split function
C# Syntax (Toggle Plain Text)
  1. string output=path.Split('.');
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Poojasrivastava is offline Offline
13 posts
since Apr 2009
May 22nd, 2009
0

Re: string manipulations

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).
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Insert to DB (Access)
Next Thread in C# Forum Timeline: Getting Mobile Device Information





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC