Skip to content

join

Join an array of strings into a single string.

s = join(A)
s = join(A, dlm)
s = join(A, dlm, dim)

Concatenates the elements of string array A, separating with the delimiter dlm (default: space). With dim, joins along the specified dimension; otherwise along the first non-singleton dimension.

join({'a', 'b', 'c'}, '-') % 'a-b-c'
join(['x'; 'y'; 'z']) % 'x y z'
  • strcat — Concatenate strings horizontally.
  • strsplit
  • append — Concatenate strings without trimming.