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,179
  • 1
  • 12
  • 20

0 Answers0