Foundational Rework (Round 2) (#2767)

This commit is contained in:
Joe Milazzo 2024-03-07 07:13:36 -07:00 committed by GitHub
parent 304fd8bc79
commit fc87dba0a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 249 additions and 84 deletions

View file

@ -1130,4 +1130,15 @@ public static class Parser
return null;
}
public static string RemoveExtensionIfSupported(string? filename)
{
if (string.IsNullOrEmpty(filename)) return filename;
if (Regex.IsMatch(filename, SupportedExtensions))
{
return Regex.Replace(filename, SupportedExtensions, string.Empty);
}
return filename;
}
}