Here you can find the source of toCharArray(CharSequence charSequence)
char []
array.
public static char[] toCharArray(CharSequence charSequence)
//package com.java2s; /*/*from www . j a v a2 s . c o m*/ * Carrot2 project. * * Copyright (C) 2002-2016, Dawid Weiss, Stanis?aw Osi?ski. * All rights reserved. * * Refer to the full license file "carrot2.LICENSE" * in the root folder of the repository checkout or at: * http://www.carrot2.org/carrot2.LICENSE */ public class Main { /** * Converts a {@link CharSequence} into a <code>char []</code> array. */ public static char[] toCharArray(CharSequence charSequence) { char[] array = new char[charSequence.length()]; for (int i = 0; i < charSequence.length(); i++) { array[i] = charSequence.charAt(i); } return array; } }