Blog Archives

How to convert Array to String in Java

package com.test;

public class ArrayTest {

public static void main(String[] args) {
ArrayTest arrayTest = new ArrayTest();
arrayTest.arrayJoin();
}

public void arrayJoin() {

String[] arrayToJoin = { “John”, “Peter”, “Tom”, “Scott” };

StringBuilder joinedString = new StringBuilder();
String seperator = “,”;
//System.out.println(“Converting to String “+arrayToJoin.toString());;
for (String value : arrayToJoin) {
joinedString.append(value).append(seperator);
}

System.out.println(“Final Result …….. ” + joinedString);
}
}

9to5Mac

Apple News & Mac Rumors Breaking All Day

Gigaom

Technology news, trends and analysis covering mobile, big data, cloud, science, energy and media

digiphile

We're already living in the future. It's just not evenly distrbuted yet.

Tech

News and reviews from the world of gadgets, gear, apps and the web

The Past and Present Future

Ken Hinckley's Ideas, Visions, and Opinions on the Research Frontiers of Human Technologies

TED Blog

The TED Blog shares interesting news about TED, TED Talks video, the TED Prize and more.

Inside BlackBerry

The Official BlackBerry Blog

Bill Mullins' Weblog - Tech Thoughts

Security and System Tools and Tips. Software Reviews, News, Views, Downloads and Links.

insanebloom

Poetry. Travel. Et cetera.