Java Collection to Array toArrays(Collection strings)

Here you can find the source of toArrays(Collection strings)

Description

to Arrays

License

Open Source License

Declaration

public static char[][] toArrays(Collection<String> strings) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2000, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://w  ww  .  j  a  va  2  s . co  m
 *     IBM Corporation - initial API and implementation
 *     daolaf@gmail.com - Contribution for bug 3292227
 *******************************************************************************/

import java.util.Collection;

public class Main {
    public static char[][] toArrays(Collection<String> strings) {
        char[][] arr = new char[strings.size()][];
        int i = 0;
        for (String str : strings) {
            arr[i++] = str.toCharArray();
        }
        return arr;
    }
}

Related

  1. toArray(final Collection collection)
  2. toArray(final Collection collection)
  3. toArray(java.util.Collection collection)
  4. toArray(T arrayOrCollection)
  5. toArrayInt(Collection integerCollection)
  6. toArrayString(Collection col, boolean spacing)
  7. toBaseTypedCollection(Collection initial)
  8. toByteArray(Collection c)
  9. toByteArray(Collection c)