id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

vowelsToFront


Write a method that accepts a string and returns the string modified like this: All vowels will be stripped out of their normal position and moved to the front of the string. Their order will not change. The remaining string will come after the vowels. Look at the test data for examples. Please note that you may assume the vowels are a, e, i, o, and u, but never y. Also, assume the vowels will only be in lower-case, so an upper-case vowel will count just like any non-vowel letter.


vowelsToFront("the game has lost you") → "eaeaoouth gm hs lst y"
vowelsToFront("Everyone should Always remember Uppper case are consonents (not really)") → "eoeouaeeeeaeaeooeoeaEvryn shld Alwys rmmbr Upppr cs r cnsnnts (nt rlly)"
vowelsToFront("A man, a plan, a canal, panama.") → "aaaaaaaaaA mn, pln, cnl, pnm."

...Save, Compile, Run (ctrl-enter)

public String vowelsToFront(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy