February 2019
Intermediate to advanced
626 pages
15h 51m
English
The PadLeft and PadRight options endeavor to increase the length of a string up to a given maximum length. Both PadLeft and PadRight take the same arguments, as follows:
PS> ''.PadRightOverloadDefinitions ------------------- string PadRight(int totalWidth) string PadRight(int totalWidth, char paddingChar)PS> ''.PadLeftOverloadDefinitions ------------------- string PadLeft(int totalWidth) string PadLeft(int totalWidth, char paddingChar)
Both methods attempt to make a string up to the total width. If the string is already equal to, or longer than the total width, it won't be changed. Unless another is supplied, the padding character is a space.
The following example pads the right-hand side of strings, using . as the padding ...
Read now
Unlock full access