append Array Object To StringBuilder - Android java.lang

Android examples for java.lang:StringBuilder

Description

append Array Object To StringBuilder

Demo Code

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;

public class Main{

    private static void appendArrayObjectToStringBuilder(
            StringBuilder stringBuilder, String delimiter, Object array) {
        int length = Array.getLength(array);
        for (int i = 0; i < length; i++) {
            appendObjectToStringBuilder(stringBuilder, delimiter,
                    Array.get(array, i));
        }/*from w w  w .  j a v  a2s .  c om*/
    }

}

Related Tutorials