public static String[] splitString(String str,int splitLength){

  char[] cs=str.toCharArray();

  int resultArrayLength=cs.length/splitLength;

  if(cs.length%splitLength!=0){

    resultArrayLength++;

  }

  String[] resultArray=new String[resultArrayLength];

 

  for (int j = 0; j <resultArray.length; j++) {

    if(j==resultArray.length-1){

      splitLength=cs.length-splitLength*j;

    }

    resultArray[j]=new String(cs,splitLength*j,splitLength);

  }

  return resultArray;

}

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-03-07
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案