fork(5) 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 data = "$GPGGA,1714.0,3723.465874,N,12202.26954,W,2,6,1.2,18.893,M,-25.669,M,2.0,0031*4F";
  14. String[] parts = data.split(",");
  15. String p2 = parts[2]; // 3723.465874
  16. String p3 = parts[3]; // N
  17. String p4 = parts[4]; // 12202.26954
  18. String p5 = parts[5]; // W
  19. System.out.println(p2);
  20. System.out.println(p3);
  21. System.out.println(p4);
  22. System.out.println(p5);
  23. }
  24. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
3723.465874
N
12202.26954
W