Here you can find the source of toList(String string)
Parameter | Description |
---|---|
string | The string to be converted. |
public static ArrayList<Character> toList(String string)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/*from w ww. j a v a2 s .co m*/ * Converts a string to a new, mutable list of Characters. * * @param string The string to be converted. * @return the list of characters. */ public static ArrayList<Character> toList(String string) { ArrayList<Character> list = new ArrayList<Character>(string.length()); for (char c : string.toCharArray()) { list.add(c); } return list; } }