title: Get substring after the first = symbol in Ruby
body: <p>Purely out of curiosity, is there a more elegant way to simply get the substring after the first <code>=</code> symbol in a string? The following works to give back <code>name=bob</code>:</p>
  
  <pre><code>string = "option=name=bob"
  string[string.index('=')+1..-1]
  </code></pre>
  
  <p>It just doesn't feel very Ruby. This also works:</p>
  
  <pre><code>string.split('=', 2)[1]
  </code></pre>
  
  <p>Again, not very elegant especially since <code>split</code> is doing extra unnecessary work. Are regular expressions the answer? I felt this was a little overkill for the simplicity of finding a single character position in a string:</p>
  
  <pre><code>string.match('=(.*)')[1]
  </code></pre>
  
  <p>I have to imagine this is an extremely common situation, isn't there a <code>string.after('=')</code> type method? Does Ruby on Rails provide something like this given the frequency this kind of operation is used over the web?</p>
  
  <p><em><strong>UPDATE</em></strong>: Forgot to mention the situation when the symbol is not found, <code>nil</code> or empty string should be returned. But the regular expression mechanism and <code>.index</code> method require an extra check for that (so less elegant).</p>