concatenate

Given a list of Strings complete the method concatenate that returns each element concatenated together but with white space.

For example: concatenate(["hello", "world"]) results in  "hello world" Note the white space in between but not at the end. 

How do you remove leading and trailing white spaces from a String? Use trim!
Example use of trim:
String test = " i love to code    ";
test = test.trim(); //removes leading and trailing white spaces

The following are methods of a list that can be used to manipulate the contained data.

Type your solution        
Skills Practiced:
3.C
3.D
4.A
4.B
Copyright © StudyCS 2024 All rights reserved.