C# Convert ToInt32(Object)
Description
Convert ToInt32(Object)
converts the value of the specified
object to a 32-bit signed integer.
Syntax
Convert.ToInt32(Object)
has the following syntax.
public static int ToInt32(
Object value
)
Parameters
Convert.ToInt32(Object)
has the following parameters.
value
- An object that implements the IConvertible interface, or null.
Returns
Convert.ToInt32(Object)
method returns A 32-bit signed integer equivalent to value, or zero if value is null.
Example
// ww w.ja va2 s.c o m
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToInt32((Object)123));
}
}
The code above generates the following result.