Languages
[Edit]
EN

C# / .NET - get file extension

7 points
Created by:
Mohammad-Oneal
327

In C# / .NET it is possible to get file extension from path in following way.

1. Path.GetExtension method example

Edit

Output:

2. String.LastIndexOf method example

Edit

Example:

Output:

3. Regex.Match method example

Edit

Example:

Output:

References

Edit
  1. Path.GetExtension Method - Microsoft Docs
  2. String.LastIndexOf Method - Microsoft Docs
  3. Regex.Match Method - Microsoft Docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

C# / .NET - file API

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join