Possible Duplicate:
What's the most elegant way to concatenate a list of values with delimiter in Java?
I have 3 different words listed in property file in 3 different lines. QWERT POLICE MATTER
I want to read that property file and store those 3 words in String, not in aarylist separated by whitespace. The output should look like this String str = { QWERT POLICE MATTER}
Now I used the follwoing code and getting the output without white space in between the words: String str = {QWERTPOLICEMATTER}. What should I do to the code to get the string result with words separated by whitespace.
FileInputStream in = new FileInputStream("abc.properties");
pro.load(in);
Enumeration em = pro.keys();
StringBuffer stringBuffer = new StringBuffer();
while (em.hasMoreElements()){
String str = (String)em.nextElement();
search = (stringBuffer.append(pro.get(str)).toString());