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