strjust

Justify strings

Syntax

  • J = strjust(str)

  • J = strjust(str, side)

Input argument

  • str - characters vector, cell of characters or string array.

  • side - 'left', 'center', 'right' (default).

Output argument

  • J - justified text

Description

J = strjust(str, side) returns the text that is justified on the side specified by side.

Examples

S = ["a"; "ab"; "abc"; "abcd"];
J = strjust (S)
J = strjust (S, 'left')
J = strjust (S, 'center')
J = strjust (S, 'right')
J = strjust('                 text', 'center')

See also

blanks.

History

Version
Description

1.0.0

initial version

Author

Allan CORNET

Last updated