title: java how to split string from end
body: <p>I have a string like "test.test.test"...".test" and i need to access last "test" word in this string. Note that the number of "test" in the string is unlimited. if java had a method like php <code>explode</code> function, everything was right, but... . I think splitting from end of string, can solve my problem.
  Is there any way to specify direction for <code>split</code> method?
  I know one solution for this problem can be like this:</p>
  
  <pre><code>String parts[] = fileName.split(".");
  //for all parts, while a parts contain "." character, split a part...
  </code></pre>
  
  <p>but i think this bad solution.</p>