Guest User

Untitled

a guest
Jul 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. String[] tokens = "C 1.1 8.15.1 P 15.10.2012 83".split(" ");
  2. String c = tokens[0];
  3. String one_dot_one = tokens[1];
  4. String eight_dot_fifteen_dot_one = tokens[2];
  5.  
  6. String[] tokensFor1_1 = one_dot_one.split(".");
  7. String[] tokensFor8_15_1 = eight_dot_fifteen_dot_one.split(".");
  8.  
  9. myObject.setVarC = c;
  10. myObject.setVar2 = Integer.parseInt(tokensFor1_1[0]);
  11. myObject.setVar3 = Integer.parseInt(tokensFor1_1[1]);
  12. myObject.setVar4 = Integer.parseInt(tokensFor8_15_1[0]);
  13. myObject.setVar5 = Integer.parseInt(tokensFor8_15_1[1]);
  14. myObject.setVar6 = Integer.parseInt(tokensFor8_15_1[2]);
  15.  
  16. if (tokens.length > 2) {
  17. // обрабатываем P 15.10.2012 83...
  18. }
Add Comment
Please, Sign In to add comment