title: How to get string if length is more than 50?
body: <p>In java how to split a string value, if >50 then the string after the last succeeding <strong>comma</strong> should be assigned to another String. </p>
  
  <p>Eg:</p>
  
  <pre><code>String test = "ASDFGHJKLPOIUYTRE YUIOOPPKMABJFD AJDJDJDJD, DJDJDJD DJDJDJ, JDJDJD UYUYUAU JKBFDKJBDKJJK";
  </code></pre>
  
  <p>the above string's length is 88.
  after 50th character @59th "," is presented so string should be split with the last succeeding "<strong>comma</strong>" and the output should be as follows:</p>
  
  <p>ASDFGHJKLPOIUYTRE YUIOOPPKMABJFD AJDJDJDJD, DJDJDJD DJDJDJ,</p>
  
  <p>JDJDJD UYUYUAU JKBFDKJBDKJJK</p>
  
  <p>thanks in advance!!!</p>
  
  <p>I have tried as follows:</p>
  
  <pre><code>if(add1.length() &gt; 50){
              for(int i=50;i&lt;add1.length();i++){
                  if(add1.charAt(i)== ','){
                      add2 = add1.substring((i+1),add1.length());
                      add1 = add1.substring(0,i);
                  }
              }
          }
  </code></pre>