title: How to split the following string
body: <p>I'm trying to split a string of the following format: Drops 3:6-9 and store them in separate data types one for Drops, one for 3, and another for 6-9 how could I do this? So far I have:</p>
  
  <pre><code>Scanner s = new Scanner(System.in);
  System.out.println("Enter the name, number, and between which lines you want to search");
  String input = s.next();
  String parts[] = input.split(" "); 
  int num1 = Integer.parseInt(parts[parts.length-1];
  int num2 = Integer.parseInt(parts[parts.length-2];
  int num3 = Integer.parseInt(parts[parts.length-3];
  String s = " ";
  for(int i = 0; i &lt; parts.length; i++) {
      s += parts[i];
  }
  </code></pre>