Unify whitespace characters to fix tests

This commit is contained in:
Tyrrrz
2025-02-04 00:17:57 +02:00
parent 75ff5c2f7e
commit f31e73bb7a
2 changed files with 54 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
using System.Text;
namespace DiscordChatExporter.Cli.Tests.Utils.Extensions;
internal static class StringExtensions
{
public static string ReplaceWhiteSpace(this string str, string replacement = " ")
{
var buffer = new StringBuilder(str.Length);
foreach (var ch in str)
buffer.Append(char.IsWhiteSpace(ch) ? replacement : ch);
return buffer.ToString();
}
}