function szStr = dimensionDisplayHelper( sz )
%iDimensionDisplayHelper  build a character vector representing array dimensions
%
%   szStr = dimensionDisplayHelper(sz) creates a character vector displaying the
%   array dimensions in sz in an N-by-M-by-... form
%
%   Examples:
%   >> szStr = iDimensionDisplayHelper([1,2,3,0])
%   szStr = 
%   1-by-2-by-3-by-0

%   Copyright 2012-2016 The MathWorks, Inc.


% Get the separator string
if ~matlab.internal.display.isDesktopInUse
    sep = char(120);
else
    sep = getString(message('parallel:array:DisplayDimensionSeparator'));
end
% Format as N-by-M-by-P-by- etc.
szStr = sprintf( ['%d',sep], sz );
% trim the final -by- from sprintf
szStr = szStr(1:end-length(sep));
end
