
% Lab 6 Solutions
% CS 1109, Summer 2011
% July 14

% This script prompts the user to enter a string. It then outputs the same
% string to the screen, after stripping it off all vowels.

str = input('Please enter a string: ', 's');

% Walk through the string one character at a time; if the character is not 
% a vowel, print it. Otherwise, don't print it.
for i = 1:length(str)
    if ((str(i) ~= 'a') & (str(i) ~= 'e') & (str(i) ~= 'i') & ...
            (str(i) ~= 'o') & (str(i) ~= 'u'))
        fprintf('%c', str(i));
    end
end

fprintf('\n');

