Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
My code
def abbreviate_sentence(sent) new_words = [] part = sent.split(' ') part.each do |ele| if ele.length > 4 new_ele = new_word_greaterthan(ele) new_words << new_ele else new_words << ele end end new_words.join('') end def new_word_greaterthan(ele) vowels = 'aeiou' no_vowels = '' ele.each_char do |char| if !vowels.include?(char) no_vowels+=char end end return no_vowels end puts abbreviate_sentence('follow the yellow bricks road')
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Division Function without / or * signs
comments
code
string orperations lecture and print
IRSTSTMIDTRNS
piramid2
Arithmetic Operations, Function Calls, Recursion and more in Ruby
Testing out multiple variable returns in a method
Adiel Vasquez
ElaineBrown** rextester.com
Please log in to post a comment.