CInt Function in VB.NET

How to convert to integer datatype in VB.Net?

Explanation

CInt Function in VB.NET - Convert String to Integer

CInt Function in Visual Basic.net 2008 is used convert a string to Integer Datatype.
Syntax:

CInt(expression)
Example:

Module Module1
Sub Main()
Dim i As Double = 12.23
Console.WriteLine("Double value converted to Integer
Datatype is::" & CInt(12.23))
Console.ReadLine()
End Sub
End Module
Result:

Double value converted to Integer Datatype is::12

In the above example, an variable 'i' of double datatype is converted to Integer datatype.

Visual Basic Tutorial


Ask Questions

Ask Question