Integer.valueOf() can be used to convert String to Integer using Apex in Salesforce.
Check the following code for reference.
Sample Code:
String str = '100';
if ( str.isNumeric() ) {
Integer intVal = Integer.ValueOf( str );
System.debug( 'intVal value is ' + intVal );
} else {
System.debug( 'String ' + str + ' is not numeric' );
}
Output:
