% function s = strtrunc(str)
% s=str;
% c=1
% while isspace(s(c)) 
%     s = s(2:length(s))
% end
% while isspace(s(length(s)))
%     s = s(1:length(s)-1);
% end
% end

function s = strtrunc(str)
if isspace(str(1))
    s = strtrunc(str(2:length(str)));
elseif isspace(str(length(str)))
    s = strtrunc(str(1:length(str)-1));
else
    s = str;
end
end