title: How to Split a string in java based on limit
body: <p>I have following String and i want to split this string into number of sub strings(by taking ',' as a delimeter) when its length reaches 36. Its not exactly splitting on 36'th position </p>
  
  <pre><code>      String message = "This is some(sampletext), and has to be splited properly";
  </code></pre>
  
  <p><strong>I want to get the output as two substrings follows:</strong><br>
  1. <strong>'This is some (sampletext)'<br>
  2. 'and  has to be splited properly'</strong></p>
  
  <p>Thanks in advance.</p>