public static List < String > toLines ( final String string ) throws IOException { if ( null == string ) { return null ; } final List < String > ret = new ArrayList <> ( ) ; try ( final BufferedReader bufferedReader = new BufferedReader ( new StringReader ( string ) ) ) { String line = bufferedReader . readLine ( ) ; while ( null != line ) { ret . add ( line ) ; line = bufferedReader . readLine ( ) ; } } return ret ; }
Converts the specified string into a string list line by line .