It is possible to delete all characters of a string that is immediately followed by two vowels, without the aid of a char array, using instead exclusively the “string” library ?
For example:
priamo -> iamo
The algorithm should be:
- Cycling the string making a for loop from
0tostring.length()-2to prevent overflow - Compare pairs of characters with a char array containing all the vowels
- Using “Erase” function in the string library to delete positions before the vowels
but I have no idea how to implement the second point without the help of an array of characters. Any suggestions?
I’d suggest using
std::adjacent_find: