Here you can find the source of toCharArrays(String[] a)
public static char[][] toCharArrays(String[] a)
//package com.java2s; /******************************************************************************* * Copyright ? 2000, 2013 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 w w. jav a 2 s. c om*/ * IBM Corporation - initial API and implementation * *******************************************************************************/ public class Main { /** * Converts a String[] to char[][]. */ public static char[][] toCharArrays(String[] a) { int len = a.length; char[][] result = new char[len][]; for (int i = 0; i < len; ++i) { result[i] = toChars(a[i]); } return result; } /** * Converts a String to char[]. */ public static char[] toChars(String s) { int len = s.length(); char[] chars = new char[len]; s.getChars(0, len, chars, 0); return chars; } }