string manipulations

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 128
Reputation: sivak has a little shameless behaviour in the past 
Solved Threads: 0
sivak sivak is offline Offline
Junior Poster

string manipulations

 
0
  #1
May 20th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 13
Reputation: Poojasrivastava is an unknown quantity at this point 
Solved Threads: 0
Poojasrivastava Poojasrivastava is offline Offline
Newbie Poster

Re: string manipulations

 
0
  #2
May 21st, 2009
use split function
  1. string output=path.Split('.');
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,721
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 501
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: string manipulations

 
0
  #3
May 22nd, 2009
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).
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 275 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC