fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. String str = "#114.034407,E,22.648272,N,0.00,0.00#010104#004500#114.03440‌​7,E,22.648272,N,0.00‌​,0.00#010104#004500";
  14. String delimiters = "(?=#\\d{1,3}\\.)";
  15.  
  16. // analyzing the string
  17. String[] tokensVal = str.split(delimiters);
  18.  
  19. // prints the number of tokens
  20. System.out.println("Count of tokens = " + tokensVal.length);
  21.  
  22. for(String token : tokensVal) {
  23. System.out.println(token);
  24. }
  25. }
  26. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
Count of tokens = 2
#114.034407,E,22.648272,N,0.00,0.00#010104#004500
#114.03440‌​7,E,22.648272,N,0.00‌​,0.00#010104#004500