This commit is contained in:
Tyrrrz
2022-09-14 02:06:11 +03:00
parent 8612d2c84a
commit a80ee2943f
6 changed files with 445 additions and 440 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace DiscordChatExporter.Core.Utils.Extensions;
@@ -25,6 +26,9 @@ public static class StringExtensions
}
}
public static string ToDashCase(this string str) =>
Regex.Replace(str, @"(\p{Ll})(\p{Lu})", "$1-$2");
public static StringBuilder AppendIfNotEmpty(this StringBuilder builder, char value) =>
builder.Length > 0
? builder.Append(value)