Thursday, July 30, 2009

I want to know detail about ToInt32 function in c#? that what it does.?

iam learning c# and want to know that what exactly toint32 and toint16 are in somewhat possible detail

I want to know detail about ToInt32 function in c#? that what it does.?
The System.Convert.ToInt32() converts a specified value into an 32-bit signed integer. There are many overloads for this method which make it possible for you to supply it with a Boolean, Byte, Char, DateTime, Decimal, Double, Int16, etc...





example of usage:


string Id = "1234";





//parse the the string "1234" into an integer.


int CustomerId = Convert.ToInt32(Id);





// CustomerId is now equal to 1234 (integral)





The Convert.ToInt16 is similar but converts the supplied value to an Int16 type (that is short)





Hope this helped.








http://msdn2.microsoft.com/en-us/library...

forsythia

No comments:

Post a Comment