Q:

Split String Array in Java (Android)

Let's say I have a String[] that looks like this:
private String[] motherOfStrings = {
  "stringA",
  "stringB",
  "stringC",
  "stringD",
  "stringE",
}

Can I split it into multiple String[] like these?
private String[] childOfString1 = {
  "stringA",
  "stringB",
  "stringC",
}

private String[] childOfString2 = {
  "stringD",
  "stringE",
}

Thanks guys :)
p.s., i did some search but most of the guides (if not all) are about splitting String[] into Strings, not another String[]. Is this even possible?

A:

You can use split() method for every string in your array.
String stringByWhichYouWantToSplit = "C";
String[][] splittedStrings = new String[motherOfStrings][];
for(int i = 0; i < motherOfStrings.length; i++)
    splittedStrings[i] = motherOfStrings.split(stringByWhichYouWantToSplit);

...if you want to split your strings by "C" ...
EDIT:
Now, when you edited question I see what you want. You have to create two arrays and copy into them strings from motherOfStrings. You can use System.arraycopy method.

