join
Combine strings
Syntax
Description
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 a1
-by-N
or anN
-by-1
string array or cell array, thennewStr
is a string scalar or a cell array that contains one character vector.If
str
is anM
-by-N
string array or cell array, thennewStr
is anM
-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
.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2016b