Write code to Convert array to String
Use the splitor symbol to join the string
Use StringBuilder class to append the string.
//package com.book2s; public class Main { public static void main(String[] argv) { String[] array = new String[] { "1", "abc", "level", null, "book2s.com", "asdf 123" }; System.out.println(array2String(array)); }// www .j a v a2 s. c o m private final static String SPLIT_SYMBOL = "|"; public static String array2String(String[] array) { if (array == null || array.length <= 0) return null; StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length - 1; i++) { builder.append(array[i]); builder.append(SPLIT_SYMBOL); } builder.append(array[array.length - 1]); return builder.toString(); } }