public int atoi(String string) {

		if(string == null || string.isEmpty()) {
			return 0;
		}
		
		int i = 0, number = 0;
		boolean isNegative = false;
		boolean isPositive = false;
		int len = string.length();
		
		if (string.charAt(0) == '-') {
			isNegative = true;
			i = 1;
		}
		else if (string.charAt(0) == '+') {
			isPositive = true;
			i = 1;
		}
		
		while (i < len) {
			number *= 10;
			number += (string.charAt(i++) - '0');
			//TODO:
			/*if (number > Character.MAX_VALUE) {
				continue;
			}*/
		}
		
		if (isNegative) {
			number = -number;
		}
		else if (isPositive) {
			number = +number;
		}
		
		return number;
	}