AvalonStudio.Extensibility.Ext.Center C# (CSharp) Method

Center() public static method

public static Center ( this stringToCenter, int totalLength ) : string
stringToCenter this
totalLength int
return string
        public static string Center(this string stringToCenter, int totalLength)
        {
            return stringToCenter
                .PadLeft(((totalLength - stringToCenter.Length) / 2) + stringToCenter.Length)
                .PadRight(totalLength);
        }