the
cpad
of
(
string ,
length ,
padding )
cpad
(
string ,
length ,
padding )
String and padding yield any string
s. Length yields an integer
.
The cpad
function both prepends and appends the specified padding to the specified string until the resulting string is longer than the specified length, then returns the middle length characters of the resulting string. In other words, the string is padded to be aligned in the center. If no padding is specified, spaces are used.
If length is zero or negative, empty
is returned. If length is shorter than the specified string, only the middle length characters of the original string are returned.