Here you can find the source of toCharacterArray(String s)
private static Character[] toCharacterArray(String s)
//package com.java2s; /****************************************************************** * License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html * * Copyright (c) 2016 {slash.bin /bin} http://slashb.in * ******************************************************************/ public class Main { private static Character[] toCharacterArray(String s) { if (s == null) return null; final Character[] c = new Character[s.length()]; for (int i = 0; i < c.length; i++) { c[i] = s.charAt(i);/*from w w w . j a v a2s . c o m*/ } return c; } }