Finding an object(s) within an array with specific letter using Ruby -


So I am trying to make a method that takes an array and a letter as a logic and A new array is included in that letter.

I have this too far:

  DF finder (array, cheese_f_fund) find = array.keep_if {| X | X.include? (Thing_to_find) == true} Return search terminated   

When I run programs in Ruby, this is saying. Include? There is no valid block method.

Any suggestions?

You can type more simple -

  def finder ( Array, cheese_t_wind) array Selection {| Words | Word.include? Thing_to_find}   

From each attribution word to that array in each iteration block Will pass. Now word.include? (Thing_to_find) will be evaluated - if it returns true , then the word will be selected and the temporary array, otherwise Not once, all the iterations will be awarded with the array , then returning that array to all the selected elements of each block execution, which were being stored in the temporary array will be given.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -