Выравнивает текст в каждой колонке, заполненной пробелами, слева, по центру или справа
TJ = justify(T, position)
векторы, матрицы или ND-массивы строк, имеющие одинаковые размеры.
Необязательный параметр с одним из следующих значений:
| 'l' или 'left' | : краюлевое выравнивание (режим по умолчанию) |
|---|---|
| 'c' или 'center' | : для выравнивания по центру |
| 'r' или 'right' | : для выравнивания по правому краю |
All heading and trailing spaces of T elements are removed
before processing.
In each given column of TJ, all strings have the same length.
Shorter strings are padded with spaces before, after, or on both sides.
The width may differ from a column to other ones. Please see the examples
m = ["a" "bcdef" "ghi" ; "jklm" "" "n" ; "opq" "rs" "tuvwxy"] justify(m) justify(m, "r") justify(m, "c") | ![]() | ![]() |
--> m = ["a" "bcdef" "ghi" ; "jklm" "" "n" ; "opq" "rs" "tuvwxy"] m = "a" "bcdef" "ghi" "jklm" "" "n" "opq" "rs" "tuvwxy" --> justify(m) ans = "a " "bcdef" "ghi " "jklm" " " "n " "opq " "rs " "tuvwxy" --> justify(m, "r") ans = " a" "bcdef" " ghi" "jklm" " " " n" " opq" " rs" "tuvwxy" --> justify(m, "c") ans = " a " "bcdef" " ghi " "jklm" " " " n " "opq " " rs " "tuvwxy"
| Version | Description |
| 2023.1 | Hypermatrix accepted. The position becomes optional,
with default = "left" |