function tf = isTextScalar(text)
%ISTEXTSCALAR Determine if value is a single piece of text
% This is similar to mustBeTextScalar underneath.
%
%   For string, a single piece of text is a 1x1 scalar. Empty double
%   quotes, "", and missing string are text scalars.
%
%   For char, a single piece of text is a row vector or the special case of
%   empty single quotes, ''.

% Copyright 2023 The MathWorks, Inc.

    tf = isCharRowVector(text) || (isstring(text) && isscalar(text));

end

function tf = isCharRowVector(text)
    tf = ischar(text) && (isrow(text) || isequal(size(text),[0 0]));
end
