title: how can I sorting strings with IF statement In RUBY
body: <p>This is codecademy`s test.</p>
  
  <p>"Use .sort! to sort the fruits array in descending (that is, reverse) alphabetical order.
  You can use the combined comparison operator (like the example above) or an if/elsif/else statement."</p>
  
  <p>They give this array</p>
  
  <pre><code>fruits = ["orange", "apple", "banana", "pear", "grapes"]
  </code></pre>
  
  <p>I did it with this code</p>
  
  <pre><code>fruits.sort!{|i,j| j&lt;=&gt;i}
  </code></pre>
  
  <p>But couldn't solve this with 'IF statement'.</p>
  
  <p>I tried everything I could for about 10 hours..</p>
  
  <p>I`m new at RUBY and programming. Can anyone help me?</p>