-1

I have a string like this:

D:\ClickSitePlayer\ClickSitePlayer\ClickSitePlayer\bin\Debug\sad_3.mp4

At the end of the string there is a file name (video name). the file name is not fixed and will change each time.

1 - How can i get file name (sad_3.mp4) in this string?

2 - After getting file name, how can i get file id? (file id comes after '_' and is 3 here)

saedbfd
  • 39
  • 2
  • 9

1 Answers1

0
  1. Path.GetFileName (MyPath)

  2. You want to probably use Regex to get a good match and extract the number.

Stackoverflow already has numerous similar questions and very good answers.

I encourage youe to expand ur search before asking.

Searching
  • 2,269
  • 1
  • 17
  • 28