code: public static int getNumber(CharSequence string) {
  		int number = 0;
  		if (!isEmptyString(string)) {
  			if (TextUtils.isDigitsOnly(string)) {
  
  				number = Integer.parseInt(string.toString());
  			}
  		}
  		return number;
  	}
docs: Extract number from string, failsafe. If the string is not a proper number it will always return 0;
  
  @param string
  : String that should be converted into a number
  
  @return : 0 if conversion to number is failed anyhow, otherwise converted number is returned