Extract a substring up to 1000th comma
<p>I have a string (comma seperated)</p>

<p>For example: </p>

<pre><code>a,bgf,sad,asd,rfw,fd,se,sdf,sdf,...
</code></pre>

<p>What I need is to extract a substring up to the 1000th comma.</p>

<p>How to achieve this in Java?</p>
