Files
Explorer-Workbench/src/Explorer.Domain/NameNormalizer.cs
netquick e9aba73552 Add Explorer Workbench with hierarchical, off-UI Storage analysis.
Storage queries run in the background with cancellation and covering indexes so switching views no longer freezes the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-22 12:43:05 +02:00

35 lines
716 B
C#

using System.Globalization;
using System.Text;
namespace Explorer.Domain;
public static class NameNormalizer
{
public static string Normalize(string name)
{
if (string.IsNullOrEmpty(name))
{
return string.Empty;
}
var form = name.Normalize(NormalizationForm.FormC);
return form.ToLower(CultureInfo.InvariantCulture);
}
public static string? Extension(string name)
{
if (string.IsNullOrEmpty(name))
{
return null;
}
var idx = name.LastIndexOf('.');
if (idx <= 0 || idx == name.Length - 1)
{
return null;
}
return Normalize(name[(idx + 1)..]);
}
}