I have referenced this in an attempt to convert my list to an array, but I can't seem to get it to work. Here is what I have:
int values[] = Arrays.asList(str.replaceAll("[^-?0-9]+", " ").trim().split(" ")).toArray();
The error that I am getting (type mismatch) is stating that I should change the type of values[] from int
to object
The end result should just be an array of numbers. Example: a-9000xyz89 would be an array with [-9000, 89] as the values