%% Remove Trailing Blanks from Character Vector
% Create a character vector that contains space, tab, and null characters.

chr = sprintf(' \t MathWorks \t');
chr = [chr char(0)];

%
% Display chr between | characters.

['|' chr '|']

%
% Remove the trailing blanks and display newChr between | characters.

newChr = deblank(chr);
['|' newChr '|']

% Copyright 2012 The MathWorks, Inc.