wes d2a2ba9e15 first commit 4 yıl önce
..
README.md d2a2ba9e15 first commit 4 yıl önce
code.cpp d2a2ba9e15 first commit 4 yıl önce
unitTest.cpp d2a2ba9e15 first commit 4 yıl önce

README.md

First N Vowels

by Matt tags: strings, regex, loops

Summary

Write a function that returns the first n vowels of a string. Examples firstNVowels("sharpening skills", 3) ➞ "aei" firstNVowels("major league", 5) ➞ "aoeau" firstNVowels("hostess", 5) ➞ "invalid" Notes Return "invalid" if the n exceeds the number of vowels in a string. Vowels are: a, e, i, o, u

Instructions

Write a function that returns the first n vowels of a string.

Examples

firstNVowels("sharpening skills", 3) ➞ "aei"

firstNVowels("major league", 5) ➞ "aoeau"

firstNVowels("hostess", 5) ➞ "invalid"

Notes

  • Return "invalid" if the n exceeds the number of vowels in a string.
  • Vowels are: a, e, i, o, u