Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

center(_:padding:)

Centers a String according to this console’s size.
func center(_ string: String, padding: Character = " ") -> String

Parameters

string

String to center.

padding

Character to use for padding, " " by default.

Return Value

String with padding added so that it is centered.