Java Array From toArray(Iterable itr)

Here you can find the source of toArray(Iterable itr)

Description

to Array

License

CDDL license

Declaration

public static String toArray(Iterable itr) 

Method Source Code

//package com.java2s;
//License from project: CDDL license 

public class Main {
    public static String toArray(Iterable itr) {
        StringBuffer sb = new StringBuffer(32);
        sb.append('[');
        for (Object obj : itr) {
            if (obj instanceof String) {
                sb.append('\'').append(obj).append("',");
            }/*from  w w w .  j  a v  a2  s .  c  o m*/
        }
        if (sb.length() > 1)
            sb.setLength(sb.length() - 1);
        sb.append(']');
        return sb.toString();
    }
}

Related

  1. toArray(int arg1)
  2. toArray(int time)
  3. toArray(int value)
  4. toArray(int value, byte b[], int offset)
  5. toArray(int[] intArray)
  6. toArray(long l, byte[] b, int offset)
  7. toArray(long value, byte[] dest, int offset, int length)
  8. toArray(Object a)
  9. toArray(Object foo)