Combine strings
combines the text in newStr
= join(str
)str
by joining consecutive elements of the
input array, placing a space character between them. str
can be a
string array or a cell array of character vectors. newStr
has the
same data type as str
.
If str
is a
1
-by-N
or an
N
-by-1
string array or cell
array, then newStr
is a string scalar or a cell array
that contains one character vector.
If str
is an
M
-by-N
string array or cell
array, then newStr
is an
M
-by-1
string array or cell
array.
For a string or cell array of any size, join
concatenates
elements along the last dimension of str
with a size that does
not equal 1
.
combines the text in newStr
= join(str
,delimiter
)str
and places the elements of
delimiter
between the elements of str
instead of a space character.
If the delimiter
argument is an array of different delimiters,
and str
has N
elements along the dimension
that is joined, then delimiter
must have N–1
elements along the same dimension. The other dimensions of
delimiter
must have either a size of 1
or
the same size as the corresponding dimension of str
.