using System.Text.RegularExpressions; namespace lxc_songlist.Services; public static partial class TextNormalizer { public static string DisplayText(string value) { return WhitespaceRegex().Replace(value.Trim(), " "); } public static string Key(string value) { return DisplayText(value).ToLowerInvariant(); } [GeneratedRegex(@"\s+")] private static partial Regex WhitespaceRegex(); }