Here you can find the source of toStringArray(Collection
Parameter | Description |
---|---|
items | a parameter |
public static String[] toStringArray(Collection<String> items)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**//from ww w .j a v a 2 s . c o m * Convert a collection of strings into a string array. * * @param items * @return */ public static String[] toStringArray(Collection<String> items) { String[] result = new String[items.size()]; int i = 0; for (String s : items) { result[i++] = s; } return result; } }