I need to concatenate two String arrays in Java.
void f(String[] first, String[] second) {
String[] both = ???
}
What is the easiest way to do this?
I need to concatenate two String arrays in Java.
void f(String[] first, String[] second) {
String[] both = ???
}
What is the easiest way to do this?
I found one good one line solution for this the code is given bellow.
ArrayUtils.addAll(T[], T...)
Code:
String[] both = ArrayUtils.addAll(first, second);