function str = toUpper(str)
% Post: Convert string so all letters are upper case
% Pre: Input is a string

% Written by Paul Chew for CS100M, Feb 2006

diff = 'a' - 'A';
for k = 1:length(str)   % Check each letter
    if 'a' <= str(k) && str(k) <= 'z'
        str(k) = char(str(k) - diff);
    end
end
