xxxxxxxxxx
private static List<Double> parseTemp(String town, String strng) {
List<Double> temps = new ArrayList<>();
for (String line : strng.split("\\n")) { //line changes in every iteration
String[] data = line.split(":");
if (town.equals(data[0])) {
for (String weather : data[1].split(",")) {
String[] temp = weather.split("\\s");
temps.add(Double.parseDouble(temp[1]));
}
break;
}
}