public static < T > T splitEachLine ( CharSequence self , CharSequence regex , @ ClosureParams ( value = FromString . class , options = "List<String>" ) Closure < T > closure ) throws IOException { return splitEachLine ( self , Pattern . compile ( regex . toString ( ) ) , closure ) ; }
Iterates through the given CharSequence line by line splitting each line using the given regex delimiter . The list of tokens for each line is then passed to the given closure .