@@ -0,0 +1,1085 @@
+public class StringtoInteger %7B%0A    public static int myAtoi(String str) %7B%0A        int len = str == null ? 0 : str.length();%0A        if (len == 0) return 0;%0A        int sign = 1, i = 0;%0A        char c = ' ';%0A        Long ret = 0l;%0A        // skip the blank characters%0A        while (i %3C len && Character.isWhitespace(c = str.charAt(i)))%0A            i++;%0A        sign = c == '-' ? -1 : 1;%0A        i = Character.isDigit(c) ? i : i + 1;%0A        // skip the blank characters between the sign and the digits%0A        while (i %3C len && Character.isWhitespace(c = str.charAt(i)))%0A            i++;%0A        while (i %3C len && Character.isDigit(c = str.charAt(i))) %7B%0A            ret  = ret * 10 + c - '0';%0A            i++;%0A        %7D%0A        ret *= sign;%0A        if (ret %3E Integer.MAX_VALUE) return Integer.MAX_VALUE;%0A        else if (ret %3C Integer.MIN_VALUE) return Integer.MIN_VALUE;%0A        else return new Long(ret).intValue();%0A    %7D%0A    %0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(myAtoi(%22    + 123   %22));%0A        System.out.println(myAtoi(%22 - 12300 %22));%0A    %7D%0A%0A%0A%7D

Complete String to Integer