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 

public class Main {
    public static String getSeparatedValuesFromArray(boolean[] separatedValuesArray) {
        if (separatedValuesArray == null || separatedValuesArray.length == 0) {
            return null;
        }

        String[] values = new String[separatedValuesArray.length];

        for (int i = 0; i < separatedValuesArray.length; i++) {
            values[i] = String.valueOf(separatedValuesArray[i]);
        }

        return getSeparatedValuesFromArray(values);

    }

    public static String getSeparatedValuesFromArray(String[] separatedValuesArray) {
        if (separatedValuesArray == null || separatedValuesArray.length == 0) {
            return null;
        }

        StringBuffer separatedValuesStringBuffer = new StringBuffer();

        for (String value : separatedValuesArray) {
            if (separatedValuesStringBuffer.length() > 0) {
                separatedValuesStringBuffer.append(";" + value);
            } else {
                separatedValuesStringBuffer.append(value);
            }
        }

        return separatedValuesStringBuffer.toString();
    }
}