protected static String[] splitStringByDelimiterPoints(String sStr,Integer[] iRes){
  ArrayList alRes=new ArrayList();
  for (int iCnt=0; iCnt < iRes.length; iCnt++) {
    if (iCnt == 0)     alRes.add(sStr.substring(0,iRes[iCnt]));
 else     alRes.add(sStr.substring(iRes[iCnt - 1],iRes[iCnt]));
  }
  if (iRes.length > 0)   alRes.add(sStr.substring(iRes[iRes.length - 1]));
 else   alRes.add(sStr);
  String[] sRes=new String[alRes.size()];
  alRes.toArray(sRes);
  return sRes;
}

protected static String [ ] splitStringByDelimiterPoints ( String sStr , Integer [ ] iRes ) { ArrayList alRes = new ArrayList ( ) ; for ( int iCnt = 0 ; iCnt < iRes . length ; iCnt ++ ) { if ( iCnt == 0 ) alRes . add ( sStr . substring ( 0 , iRes [ iCnt ] ) ) ; else alRes . add ( sStr . substring ( iRes [ iCnt - 1 ] , iRes [ iCnt ] ) ) ; } if ( iRes . length > 0 ) alRes . add ( sStr . substring ( iRes [ iRes . length - 1 ] ) ) ; else alRes . add ( sStr ) ; String [ ] sRes = new String [ alRes . size ( ) ] ; alRes . toArray ( sRes ) ; return sRes ; }
returns the substrings defined by a string and a set of split points .
