java collapse string array

Solutions on MaxInterview for java collapse string array by the best coders in the world

showing results for - "java collapse string array"
Corentin
26 Jun 2017
1String[] array = {"0","1","2","3","4","5","6","7","8","9"};
2String s = String.join(" ", array); //<- (delimiter, target array)
3Syste.out.println(s);
4
5Output:
60 1 2 3 4 5 6 7 8 9