0

I have a string that I want to be split into an array by 4 characters

String I have:

String str = "ABCDEFGHIJKLMNOP";

I want output of:

String[] array = ["ABCD", "EFGH", "IJKL", "MNOP"];

Is there a way to do this?

Jeremy P
  • 1,309
  • 2
  • 13
  • 22

0 Answers0