str = strjoin(C) constructs str
by linking the elements of C with a space between consecutive
elements. C can be a cell array of character vectors or a string
array.
C — Input text 1-by-n cell array of character
vectors | 1-by-n string array
Input text, specified as a 1-by-n cell array of
character vectors or string array.
Example: {'The','rain','in','Spain'}
Example: ["Four","score","and","seven"]
Data Types: cell | string
delimiter — Delimiting characters character vector | 1-by-n cell array of character
vectors | 1-by-n string array
Delimiting characters, specified as a character vector, a
1-by-n cell array of character
vectors, or a 1-by-n string
array.
If delimiter is a character vector,
then strjoin forms str by
inserting delimiter between each element of C.
The delimiter input can include any of these escape
sequences:
\\
Backslash
\0
Null
\a
Alarm
\b
Backspace
\f
Form feed
\n
New line
\r
Carriage return
\t
Horizontal tab
\v
Vertical tab
If delimiter is a cell array of
character vectors, then it must contain one fewer element than C.
Each element in the cell array must contain a character vector. strjoin forms str by
interleaving the elements of delimiter and C.
All characters in delimiter are inserted as literal
text, and escape sequences are not supported.
Example: ', '
Example: {',','
'}
Data Types: char | cell | string
Tips
Starting in R2016b, the join function
is recommended to join elements of a string array.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Input text must be a string scalar or a cell array of character
vectors.
Generated code returns an empty output as a 1-by-0
character array.