java collapse string array

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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