mlreportgen.utils.makeSingleLineText class

Package: mlreportgen.utils
Superclasses:

Convert input to single line

Construction

singleline = mlreportgen.utils.makeSingleLineText(strchar_in) converts the input to a single line of text. Single spaces replace the line feeds and carriage returns in the input.

singleline = mlreportgen.utils.makeSingleLineText(strchar_in,delim) specifies the delimiter to use to replace line feeds and carriage returns.

Input Arguments

expand all

Input to convert to single line of text, specified as a character array, string, string array, cell array of characters, or numeric array.

Delimiter to substitute for each line feed and carriage return, specified as a scalar string or character array.

Output Arguments

expand all

Single line of text, returned as a character array or string. The formatting of the output depends on the input type.

InputOutput
character array or numeric arrayCharacter array with line feeds and carriage returns removed
stringString with line feeds and carriage returns removed.
cell array of character vectorsCharacter array with line feeds and carriage returns removed. Entries in the array are concatenated and separated using the delimiter
string array

String with line feeds and carriage returns removed. Entries in the array are concatenated and separated using the delimiter.

Examples

Convert String Array to Single Line

devTitle = ['Thomas R. Lee'; ...
            'Sr. Developer'; ...
            'SFTware Corp.'];
singleline = mlreportgen.utils.makeSingleLineText(devTitle)
singleline =

    'Thomas R. Lee Sr. Developer SFTware Corp.'

Introduced in R2018b