fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String str = "\nHERE\n\nTHERE\n\nEVERYWHERE\n\n";
  9. String strArray[] = str.split("\n", Integer.MAX_VALUE);
  10.  
  11. System.out.println("strArray.length - " + strArray.length);
  12. for(int i = 0; i < strArray.length; i++)
  13. System.out.println("strArray[" + i + "] - \"" + strArray[i] + "\"");
  14. }
  15. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
strArray.length - 8
strArray[0] - ""
strArray[1] - "HERE"
strArray[2] - ""
strArray[3] - "THERE"
strArray[4] - ""
strArray[5] - "EVERYWHERE"
strArray[6] - ""
strArray[7] - ""