Move some text filtering functionality

This commit is contained in:
Matt Nadareski
2023-08-15 01:58:47 -04:00
parent ede4487cf0
commit 5044dea02a
3 changed files with 17 additions and 188 deletions

View File

@@ -128,6 +128,17 @@ namespace SabreTools.Core.Tools
return new string(input.Where(c => !invalidPath.Contains(c)).ToArray());
}
/// <summary>
/// Remove all unicode-specific chars from a string
/// </summary>
public static string? RemoveUnicodeCharacters(string? input)
{
if (string.IsNullOrWhiteSpace(input))
return input;
return new string(input.Where(c => c <= 255).ToArray());
}
#endregion
#region Helpers