I want to trim the following string "Uploads\photoshop.pdf"
the result should be "photoshop.pdf"
how to do?Can anyone help me out..
How to use trim function in C#?
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.


venkata kumarRank #5,034 · 314 reputationPosted Nov 5, 2013, 9:39 PM EST
try this
string[] result= ("Uploads\photoshop.pdf").split('\');
string res=result[1];
brahmam marabathula2 reputationPosted Nov 5, 2013, 10:00 PM EST
string str = "hai/"
str.TrimEnd('/');
Abhay ShankerRank #375 · 6.7K reputationPosted Nov 5, 2013, 10:45 PM EST
VulpesRank #55 · 29.2K reputationPosted Nov 6, 2013, 2:05 AM EST
Hemant SrivastavaRank #581 · 4.2K reputationPosted Nov 6, 2013, 4:22 AM EST