-3

I am having a situation here... I have a value like this in a variable like this

var getfile ="C:\Users\rohithkk\documents\visual studio 2010\Projects\jstree3\jstree3\UploadedFiles\30102014214816202_JST.ods"

Here i want to get the value like this "30102014214816202_JST.ods" is there any way to do it in c#?

Thanks

Krishna
  • 1,332
  • 5
  • 20
  • 35
  • No regex needed here. Just research effort. – Sayse Oct 31 '14 at 07:37
  • Funny. They all r coming with different methods for this. He asked for a regex-solution didnt he? http://www.dotnetperls.com/regex-match – C4d Oct 31 '14 at 07:38
  • 2
    @C4ud3x: Often the solution someone *asks* for isn't the most appropriate one for the situation. (Example: just a little while ago, someone asked how to escape quotes in values in MySQL. The best solution is not to escape them at all, but to use parameterized SQL.) – Jon Skeet Oct 31 '14 at 07:40
  • 1
    @C4ud3x - [What is the XY problem?](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – Sayse Oct 31 '14 at 07:40
  • @Sayse: Interesting. I stand corrected. – C4d Oct 31 '14 at 07:49

1 Answers1

0

Yes there is a way.

Path.GetFileName()

http://msdn.microsoft.com/tr-tr/library/system.io.path.getfilename(v=vs.110).aspx

Emre Acar
  • 920
  • 9
  • 24