Add proper support for more system notifications

Closes #844
This commit is contained in:
Tyrrrz
2023-02-09 19:50:41 +02:00
parent a95d2ef298
commit 3b2c308a25
8 changed files with 126 additions and 27 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace DiscordChatExporter.Core.Utils.Extensions;
@@ -27,9 +26,6 @@ public static class StringExtensions
}
}
public static string ToDashCase(this string str) =>
Regex.Replace(str, @"(\p{Ll})(\p{Lu})", "$1-$2");
public static T? ParseEnumOrNull<T>(this string str, bool ignoreCase = true) where T : struct, Enum =>
Enum.TryParse<T>(str, ignoreCase, out var result)
? result