int sample2 = Integer.parseInt("47"); // returns 47
int sample3 = Integer.parseInt("+4"); // returns 4
String phrase = "12";
int i;
i = Integer.parseInt(phrase);
String number = "1"
int num = Integer.parseInt (name);
//num equals 1
public int stringToInt(String str) {
// deleting everything that is not numeric
return Integer.parseInt(str.replaceAll("[^0-9.]",""));
}