User Tools

Site Tools

Navigation:  Language Reference > 13 - Built-in Functions >====== CENTER (return centered string) ====== Previous pageReturn to chapter overviewNext page

CENTER(string [,length])


CENTER Returns centered string.
string A string constant, variable or expression.
length The length of the return string. If omitted, the length of the string parameter is used.

The CENTER procedure first removes leading and trailing spaces from a string, then pads it with leading and trailing spaces to center it within the length, and returns a centered string.

Return Data Type: STRING


 !CENTER('ABC',5) returns ' ABC '

 !CENTER('ABC ')  returns ' ABC '

 !CENTER(' ABC')  returns ' ABC '

 Message = CENTER(Message)    !Center the message

 Rpt:Title = CENTER(Name,60)  !Center the name

See Also:



center_return_centered_string_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)