Other people have already answered how to do this, but if you want to make this a more dynamic process (being able to handle more than 2 numbers without explicitly writing out the code for each), here is an example of such a method:
public static double[] getDoublesSeperatedByCommas(String textWithNumbers) {
String[] textParts = textWithNumbers.split(",");
double[] returnDoubles = new double[textParts.length];
for (int i = 0; i < textParts.length; i++) {
if (textParts[i].isEmpty())
returnDoubles[i] = 0;
else
returnDoubles[i] = Double.parseDouble(textParts[i]);
}
return returnDoubles;
}
That method will take a String (like the one you specified) and return a double array with all the specified values which were separated by commas. I also added a simple check to see if the strings were empty (eg: "245,5653,,346")
-Thomas