Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String joinArray(String[] array, String separator) {
        if (null == array || array.length <= 0) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (String s : array) {
            sb.append(separator).append(s);
        }
        return sb.toString().substring(separator.length());
    }
}