Files
Ragon/Ragon/Sources/Extensions/StringExtensions.cs
T

14 lines
300 B
C#
Raw Normal View History

2022-04-24 09:05:15 +04:00
using System;
namespace Ragon.Core
{
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);
}
}
}