title: Finding the whether the element of the Array is last or not in ruby
body: <p>Lets suppose we have an array</p>
  
  <pre><code>p = String.new
  a = ['d','e','f','g','h']
  a.each do |value|
   p &lt;&lt; value
   p &lt;&lt; "%" if value is not last
  end
  </code></pre>
  
  <p>I need to determine whether the a['h'] is the last index value or not?</p>
  
  <p>Is there a shortcut way to find it like a.is_last?()</p>