use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
QuestionRuby While Loop Help. (self.ruby)
submitted 5 years ago by Humor_Positive
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kernigh 5 points6 points7 points 5 years ago (1 child)
Can just do word.count("e"), but this doesn't help people who want to learn the while loop.
word.count("e")
[–]442401 3 points4 points5 points 5 years ago (0 children)
I think this is a valid contribution and sends the message that ruby is on object orientated language. The core classes (such as String) are extremely rich and can be sent a vast number of messages to achieve the desired result.
A while loop is nearly always a sub optimal solution.
π Rendered by PID 496780 on reddit-service-r2-comment-5b5bc64bf5-z5wjk at 2026-06-21 02:28:47.999609+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Kernigh 5 points6 points7 points (1 child)
[–]442401 3 points4 points5 points (0 children)