I have a String variable (basically an English sentence with an unspecified number of numbers) and I\'d like to extract all the numbers into an array of integers. I was wond
public static String extractNumberFromString(String number) { String num = number.replaceAll("[^0-9]+", " "); return num.replaceAll(" ", ""); }
extracts only numbers from string