apex string to integer code example Example: cast string to integer apex Integer i; String s; s='10'; i=integer.valueof(s);