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 adaptTags(String[] tags, String noneText, String delimiter) {
        if (tags.length == 0)
            return noneText;
        if (tags.length == 1)
            return tags[0];
        final StringBuffer result = new StringBuffer();
        for (int i = 0; i < (tags.length - 1); i++) {
            result.append(tags[i]).append(delimiter);
        }
        result.append(tags[tags.length - 1]);
        return result.toString();
    }

    public static String adaptTags(String[] tags, String noneText) {
        return adaptTags(tags, noneText, " / ");
    }
}