dash.assert.string

Throw error if input is not a string array, cellstring array, or character row vector


Syntax



Description

str = dash.assert.string(input)

Checks if an input is either a string array, cellstring array, or char row vector. If not, throws an error. If so, returns the input as a string data type.

str = dash.assert.string(input, name, header)

Customize message and header of thrown errors.


Input Arguments

input

any data type
The input being checked

name

string scalar
The name of the input in the calling function. Default is “input”.

Output Arguments

str

string array
The input converted to a string data type.