dotnet / dotnet/dotnet-api-docs
Documentation doesn't state behaviour when a file has multiple extensions
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
It would be nice to have a note/remark on this documentation page stating how files with multiple file extensions are handled, and maybe why that is the case.
If a file has multiple extensions only the *last* extension will be returned (filename.txt.zip would thus only return the .zip extension) because the .Extension method traverses over the string from end to start looking for the first encouter of "." and returns a substring from that instance to the last character.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 0b4ee7a4-ba70-be61-35ae-c82b57d8e83d
* Version Independent ID: 1a50f2ed-c2e1-61da-02ca-58a9ccedc57a
* Content: [FileSystemInfo.Extension Property (System.IO)](https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.extension?view=netframework-4.7.2#remarks)
* Content Source: [xml/System.IO/FileSystemInfo.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.IO/FileSystemInfo.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.