title: splitting a string('_' as delimiter)
body: <p>I have following string </p>
  
  <pre><code>String S1="S1_T1_VIEW";
  </code></pre>
  
  <p>I want it to be split and assign to string like this:</p>
  
  <pre><code>String permission = "VIEW";
  String component = "S1_T1";
  String parent = "S1";
  </code></pre>
  
  <p>I tried using using <code>S1.split()</code>  function it didn't help much.</p>
  
  <p>String can also be like this</p>
  
  <pre><code>String S1="S1_T1_C1_DELETE";
  </code></pre>
  
  <p>That time results should be</p>
  
  <pre><code>String permission = "DELETE";
  String component = "S1_T1_C1";
  String parent = "S1_T1";
  </code></pre>
  
  <p>Any suggestions would be helpful .</p>
  
  <p>Thanks in advance</p>