Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:57:16+00:00 2026-06-09T15:57:16+00:00

It is possible to delete all characters of a string that is immediately followed

  • 0

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:

  1. Cycling the string making a for loop from 0 to string.length()-2 to prevent overflow
  2. Compare pairs of characters with a char array containing all the vowels
  3. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:57:17+00:00Added an answer on June 9, 2026 at 3:57 pm

    I’d suggest using std::adjacent_find:

    std::string s{"priamo"};
    auto is_vowel = [](char c) -> bool {
        static const char vowels[] = "aeiou";
        return std::any_of(std::begin(vowels), std::prev(std::end(vowels)),
            [c](char d) { return c == d; } );
    };
    auto it = std::adjacent_find(s.crbegin(), s.crend(),
        [&](char c, char d) { return is_vowel(c) && is_vowel(d); }).base();
    if (it != s.cbegin())
        s.erase(s.cbegin(), std::prev(it, 2));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to delete all lines that have the same first 30 characters
Is it possible to delete all databases that were created by a specific user?
Is it possible to delete all data in the database using NHibernate. I want
is it possible to delete all the records in a MSaccess table using c#?
Possible Duplicate: Prolog delete: doesn't delete all elements that unify with Element In Prolog
Is it possible to delete all items in a list that don't contain a
Possible Duplicate: What's the best way to delete all data from a table? Clear
Possible Duplicate: Delete a folder on SD card In my app i saved all
Is it possible to delete files using WebDav by file name pattern? For example,
Is it possible to delete some images from the browser (firefox2) memory using javascript?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.