Part of my application I encountered this problem. The String
line variable contains 12.2 Andrew and I'm trying to split them separately but it doesn't work and comes with a NumberFormatException
error. Could you guys help me on that please?
String line = "12.2 Andrew";
String[] data = line.split("(?<=\\d)(?=[a-zA-Z])");
System.out.println(Double.valueOf.(data[0]));