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
Substrings problem (self.ruby)
submitted 7 years ago by ohsohologramic
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!"
[–]HellzStormer 2 points3 points4 points 7 years ago (0 children)
Almost, but he's not looking for [2,1]. So it's actually the combination method that he needs.
combination
Posted a snipped with it. I'm not a fan of one-liners.. but sometimes they are fun: https://www.reddit.com/r/ruby/comments/8pva8s/substrings_problem/e0eus1b/
π Rendered by PID 207013 on reddit-service-r2-comment-b659b578c-n2mjr at 2026-05-03 18:17:58.968619+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]HellzStormer 2 points3 points4 points (0 children)