mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-14 03:08:27 -04:00
Nuked humanizer. Some of the strings might look worse but the output directory will no longer look terrible. Added stats for todo list command
This commit is contained in:
@@ -29,7 +29,17 @@ public static class StringExtensions
|
||||
=> Regex.Replace(input, "<.*?>", string.Empty);
|
||||
|
||||
public static string? TrimTo(this string? str, int maxLength, bool hideDots = false)
|
||||
=> hideDots ? str?.Truncate(maxLength, string.Empty) : str?.Truncate(maxLength);
|
||||
{
|
||||
if (hideDots)
|
||||
{
|
||||
return str?.Substring(0, maxLength);
|
||||
}
|
||||
|
||||
if (str is null || str.Length <= maxLength)
|
||||
return str;
|
||||
|
||||
return string.Concat(str.AsSpan(0, maxLength - 1), "…");
|
||||
}
|
||||
|
||||
public static string ToTitleCase(this string str)
|
||||
{
|
||||
|
Reference in New Issue
Block a user