Code commit

This commit is contained in:
RisaDev
2024-01-06 01:21:41 +03:00
parent a7d7297c59
commit a486dd2c96
90 changed files with 11576 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using Dalamud.Utility;
namespace CustomizePlus.Core.Extensions
{
internal static class StringExtensions
{
/// <summary>
/// Incognify string. Usually used for logging character names and stuff. Does nothing in debug build.
/// </summary>
public static string Incognify(this string str)
{
if (str.IsNullOrWhitespace())
return str;
#if DEBUG
return str;
#endif
if (str.Contains(" "))
{
var split = str.Split(' ');
if (split.Length > 2)
return $"{str[..2]}...";
return $"{split[0][0]}.{split[1][0]}";
}
return $"{str[..2]}...";
}
}
}