Although you can remove leading and trailing white space using nested
fliplr
and deblank
calls, strtrim
results in code that executes much faster and is easier to read.
Convert code such as
fliplr(deblank(fliplr(deblank(str))))
and
deblank(fliplr(deblank(fliplr(str))))
to
strtrim(str)