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 7811059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:01:14+00:00 2026-06-02T04:01:14+00:00

In my Ruby program, I have an array of five strings, and I want

  • 0

In my Ruby program, I have an array of five strings, and I want to check if each one of the elements of that array match to a given requirement, for example:

a = ['', '', '', '']
a.inject(:blank?) # Will return true if (and only if) all elements of a are blank

I’m asking this question because Ruby has a pretty large standard API with a lot of pre-written syntactical sugar, which I want to know and don’t want to reinvent.

  • 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-02T04:01:15+00:00Added an answer on June 2, 2026 at 4:01 am

    There is a very concise way:

    array.all? &:blank?
    

    Study Enumerable and learn how to use Enumerators and you’ll be speaking the most pleasant dialect of Ruby in no time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So all I simply want to do is make a Ruby program that reads
I have a Ruby program that zips a directory tree of XML files using
I have a Ruby program that loads up two very large yaml files, so
I'm running a program in Ruby on Rails and have an array of hashes
I have a Ruby program that generates files that contain a Module definition :
I have a ruby program, and I want to accept the user's made up
I have a basic ruby program, that listens on a port (53), receives the
I have a ruby program on my machine. I want call it over the
I have a Ruby program that takes as input an HTML document. The structure
I have been trying to create a Ruby program that will be running online

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.