dream3323 2017-01-30 17:11
浏览 1207
已采纳

如何在Android Studio上将非常长的字符串拆分为多个字符串? [重复]

This question already has an answer here:

Hello i wanna split a very long string ( +10000 character) to multiple String.

I found there is a way with split() but i don't have space " " to split it.

I have only letter. Can i use a loop to split it?

For Example: it 's possible to split the string to multiple strings with 200 character for each one.

</div>
  • 写回答

1条回答 默认 最新

  • dongzhuifeng1843 2017-01-30 17:46
    关注

    As solved by this link, you can use Regex to achieve your requirement

    try

    System.out.println(Arrays.toString(
        "Thequickbrownfoxjumps".split("(?<=\\G.{4})")
    ));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料