Here you can find the source of toList(String str)
public static ArrayList<Character> toList(String str)
//package com.java2s; /**/*from www. j ava2 s .c om*/ * Computes the Levenshtein Distance between two strings. * <p/> * This code is sourced and unmodified from wikibooks under * the Creative Commons attribution share-alike 3.0 license and * by be re-used under the terms of that license. * <p/> * http://creativecommons.org/licenses/by-sa/3.0/ * <p/> * TODO: re-implement for efficiency/licensing possibly. */ import java.util.ArrayList; public class Main { /** * Converts a string to a list of Characters. */ public static ArrayList<Character> toList(String str) { ArrayList<Character> myArrayList = new ArrayList<>(str.length()); for (int i = 0; i < str.length(); i++) { myArrayList.add(i, str.charAt(i)); } return myArrayList; } }