AvalonStudio.Extensibility.Ext.Center C# (CSharp) Méthode

Center() public static méthode

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