function tf = isNontrivialText(value)
%MATLAB Code Generation Library Function

%   Copyright 2022 The MathWorks, Inc.
%#codegen

    % istext
    % {} and string.empty are empty but not trivial text
    if ~(coder.internal.isTextRow(value)) && ~isstring(value) && ~iscellstr(value)
        tf = false;
        return;
    end

    % make sure input has at least one character
    if iscell(value)
        % cell string
        for i = 1:numel(value)
            if strlength(value{i})<=0
                tf = false;
                return;
            end
        end
    else
        % char vector or scalar string
        tf = (strlength(value)>0);
        return;
    end
    
    tf = true;
end