function x = wrapBoundaryInput(x)
% Make sure the boundary inputs to eraseBetween, extractBetween etc. are
% scalar strings so that they are treated as a single element for elementfun.

% Copyright 2016-2020 The MathWorks, Inc.

if ischar(x)
    % Check for column or matrix char arrays before wrapping
    if ~isempty(x) && ~isrow(x)
        msg = message('MATLAB:string:MustBeTextOrNumeric', getString(message('MATLAB:string:Boundary')));
        throwAsCaller(MException(msg));
    end
    x = string(x);
end
end
