diff --git a/program/program/convert-string-to-vowelcase/convert_string_to_vowelcase.pl b/program/program/convert-string-to-vowelcase/convert_string_to_vowelcase.pl new file mode 100644 index 000000000..319983d69 --- /dev/null +++ b/program/program/convert-string-to-vowelcase/convert_string_to_vowelcase.pl @@ -0,0 +1,15 @@ +print "Enter a string: "; +chomp(my $str = ); +my $result = ''; +$str = lc($str); +foreach my $char (split //, $str) +{ + if ($char =~ /[aeiou]/) + { + $result .= uc($char); + } + else + { + $result .= lc($char); + }} +print $result;