Java List to String Array listToStringArray(List objs)

Here you can find the source of listToStringArray(List objs)

Description

list To String Array

License

Open Source License

Declaration

public static String[] listToStringArray(List objs) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static String[] listToStringArray(List objs) {
        return collectionToStringArray(objs);
    }//from   w w  w .j  a  v  a  2 s.  com

    public static String[] collectionToStringArray(Collection objs) {
        if (objs == null)
            return null;
        String[] ret = new String[objs.size()];
        int idx = 0;
        for (Object o : objs) {
            ret[idx] = o.toString();
            idx++;
        }
        return ret;
    }
}

Related

  1. listToStringArray(List list)
  2. listToStringArray(List objectList)
  3. listToStringArray(List inputList)
  4. listToStringArray(List list)
  5. listToStringArray(List list)