Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;
import java.util.List;

public class Main {
    public static String StringArrayToString(String[] array) {
        return StringArrayToString(Arrays.asList(array));
    }

    public static String StringArrayToString(List<String> array) {
        StringBuilder sb = new StringBuilder();
        for (String n : array) {
            if (sb.length() > 0)
                sb.append(',');
            sb.append("").append(n).append("");
        }
        return sb.toString();
    }
}