Trim local path when retrieve a file
hi i need a help,in c# windows application how to trim the local path.(ex:c:\user\newfolder\test.txt) i want to trim this
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Apr 23, 2014, 2:54 AM EDT
System.IO.Path.GetFileName(fullPath)
Vasu GadhiyaRank #7,540 · 239 reputationPosted Apr 23, 2014, 2:58 AM EDT
if you want to remove White space from string than you can use use trim mathod.
like
string temp = " csharpcorner";
temp.Trim();
-----
now temp = "csharpcorner"
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 23, 2014, 4:14 AM EDT
actually I am not getting your question.