How can I concatenate two arrays in Java? -
i need concatenate 2 string arrays in java.
void f(string[] first, string[] second) { string[] both = ??? }
what easiest way this?
i found one-line solution old apache commons lang library.
arrayutils.addall(t[], t...)
code:
string[] both = (string[])arrayutils.addall(first, second);
Comments
Post a Comment