Guest User

Untitled

a guest
Jan 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. “Inditex;22.72;22.95 Telecinco;10.02;11.02”
  2.  
  3. public String [][] partirString (String acc) {
  4. String [] [] res;
  5. //Primero partimos por el espacio
  6. String [] aux = acc.split(" ");
  7. //Con esto sabemos el número de filas de la matriz
  8. res = new String[aux.length][];
  9. //Ahora partiremos por el ;
  10. for (int ii=0; ii<aux.length;ii++){
  11. res[ii] = aux[ii].split(";");
  12. }
  13. return res;
  14. }
  15.  
  16. 1 public String [][] partirString (String acc) {
  17. 2 String [] [] res;
  18. 3
  19. 4 String [] aux = acc.split(" ");
  20. 5 //Con esto sabemos el número de filas de la matriz
  21. 6 res = new String[aux.length][];
  22. 7 //Ahora partiremos por el ;
  23. 8 for (int ii=0; ii<aux.length;ii++){
  24. 9 res[ii] = aux[ii].split(";");
  25. 10 }
  26. 11 return res;
  27. 12 }
  28.  
  29. { "Inditex;22.72;22.95", "Telecinco;10.02;11.02" }
  30.  
  31. aux= { null, null }
  32.  
  33. {
  34. {"Inditex", "22.72","22.95"},
  35. {"Telecinco", "10.02","11.02"}
  36. }
Add Comment
Please, Sign In to add comment