Code style fix

This commit is contained in:
RisaDev
2024-01-08 05:31:55 +03:00
parent 2b8db843a1
commit 44607e10d7

View File

@@ -1,32 +1,31 @@
using Dalamud.Utility;
namespace CustomizePlus.Core.Extensions
namespace CustomizePlus.Core.Extensions;
internal static class StringExtensions
{
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)
{
/// <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 (str.IsNullOrWhitespace())
return str;
#if !INCOGNIFY_STRINGS
return str;
return str;
#endif
if (str.Contains(" "))
{
var split = str.Split(' ');
if (str.Contains(" "))
{
var split = str.Split(' ');
if (split.Length > 2)
return $"{str[..5]}...";
if (split.Length > 2)
return $"{str[..5]}...";
return $"{split[0][0]}.{split[1][0]}";
}
return $"{str[..5]}...";
return $"{split[0][0]}.{split[1][0]}";
}
return $"{str[..5]}...";
}
}