mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Improved .shardstats format + small cleanup
This commit is contained in:
@@ -12,6 +12,13 @@ namespace NadekoBot.Extensions
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string PadBoth(this string str, int length)
|
||||
{
|
||||
int spaces = length - str.Length;
|
||||
int padLeft = spaces / 2 + str.Length;
|
||||
return str.PadLeft(padLeft).PadRight(length);
|
||||
}
|
||||
|
||||
public static T MapJson<T>(this string str)
|
||||
=> JsonConvert.DeserializeObject<T>(str);
|
||||
|
||||
|
Reference in New Issue
Block a user