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 generateInStrForInteger(String[] strValues) {
        return generateInStr(strValues, "");
    }

    public static String generateInStr(String[] values) {
        return generateInStr(values, "'");
    }

    private static String generateInStr(String[] values, String quote) {

        StringBuffer buffer = new StringBuffer("( ");
        int i;
        for (i = 0; i < values.length - 1; i++)
            buffer.append(quote + values[i] + quote + ", ");
        buffer.append(quote + values[i] + quote + " )");
        return buffer.toString();
    }
}