In my program, I need to extract numbers from a String the given string is the following.

```
String numberOfHours = "12.0  8.0  7.0  7.0  10.0  8.0  0.0  2.0";

```

I need to extract each value into an array. When I use the split method from the String class I get a null value and also I don't get all the numbers in the array. Here's the code.

```
   String pieces[] = numberOfHours.split("  ");  

    for(int i = 0 ; i < hoursPerDay.length ; i++){
            System.out.println(pieces[i]); 
    }

```

Thanks in advance!