title: Java API to split a string into substrings of different length
body: <p>I have a input string of known length. I have to split this input string in 30 substrings of different lengths. 
  <strong>For ex:-</strong> </p>
  
  <pre><code>Input string: "abcdefghijklmnopqrstuvwxyz"
  Output string: "a","bcd","efgij","kl","mnopqrstu","v","wx","yz"
  </code></pre>
  
  <p>I wanted to know if there is some sort of API or way where I can provide the lengths, based on which I want to split the string, and get the output at one go instead of multiple steps.</p>
  
  <p>Any help will be highly appreciated.</p>