title: How to find nth occurrence of character in a string?
body: <p>Similar to a question posted <a href="https://stackoverflow.com/questions/2571716/find-nth-occurrence-of-a-character-in-a-string" title="Find Nth occurrence of a character in a string">here</a>, am looking
  for a solution in Java.</p>
  
  <p>That is, how to find the index of nth occurrence of a character/string from a string?</p>
  
  <p><em>Example:</em> "<strong>/folder1/folder2/folder3/</strong>". 
  In this case, if I ask for 3rd occurrence of slash (/), it appears before folder3, and I expect to return this index position.  My actual intention is to substring it from nth occurrence of a character.</p>
  
  <p>Is there any convenient/ready-to-use method available in Java API or do we need to write a small logic on our own to solve this?</p>
  
  <p>Also, </p>
  
  <ol>
  <li>I quickly searched whether any method is supported for this purpose at Apache Commons Lang's <a href="http://commons.apache.org/lang/api/org/apache/commons/lang3/StringUtils.html" rel="noreferrer" title="org.apache.commons.lang3.StringUtils">StringUtils</a>, but I don't find any.</li>
  <li>Can regular expressions help in this regard?</li>
  </ol>