-1

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.

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213

1 Answers1

0

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

try

System.out.println(Arrays.toString(
    "Thequickbrownfoxjumps".split("(?<=\\G.{4})")
));
Community
  • 1
  • 1
  • 3
    Please **do not** copy other answers and post them as your own.. At the very least you should have atleast modified the regex to suit the question requirements.. – ashkhn Jan 30 '17 at 18:29
  • I couldn't comment because of the Low reputation. I was only posting the link, stack overflow didn't allow me that due to word limit so I pasted the method. And I am clearly mentioning that's not my answer. I know this should have been a comment. – Dhananjay Sarsonia Jan 30 '17 at 19:04
  • Sorry I just saw I can comment now, didn't realise that I passed that barrier. Apologies. – Dhananjay Sarsonia Jan 30 '17 at 19:09