After doing
String delims = "[\n]";
String[] tokens = text.split(delims); //text is composed of one single word per line
I would need to know how many lines (via the number of components of the corresponding splitted string)
int k=tokens.length(); //does not work
Is there a method for doing this?