Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Conversion Class

The Conversion module contains the procedures used to perform various conversion operations.

System.Object
  Microsoft.VisualBasic.Conversion

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
'Declaration
<StandardModuleAttribute> _
Public NotInheritable Class Conversion

The Conversion type exposes the following members.

  NameDescription
Public methodStatic memberCTypeDynamic(Object, Type)Converts an object to the specified type.
Public methodStatic memberCTypeDynamic(Of TargetType)(Object)Converts an object to the specified generic type.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodStatic memberErrorToStringReturns the error message that corresponds to a given error number.
Public methodStatic memberErrorToString(Int32)Returns the error message that corresponds to a given error number.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFix(Decimal)Return the integer portion of a number.
Public methodStatic memberFix(Double)Return the integer portion of a number.
Public methodStatic memberFix(Int16)Return the integer portion of a number.
Public methodStatic memberFix(Int32)Return the integer portion of a number.
Public methodStatic memberFix(Int64)Return the integer portion of a number.
Public methodStatic memberFix(Object)Return the integer portion of a number.
Public methodStatic memberFix(Single)Return the integer portion of a number.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberHex(Byte)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int16)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int32)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int64)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Object)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(SByte)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt16)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt32)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt64)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberInt(Decimal)Return the integer portion of a number.
Public methodStatic memberInt(Double)Return the integer portion of a number.
Public methodStatic memberInt(Int16)Return the integer portion of a number.
Public methodStatic memberInt(Int32)Return the integer portion of a number.
Public methodStatic memberInt(Int64)Return the integer portion of a number.
Public methodStatic memberInt(Object)Return the integer portion of a number.
Public methodStatic memberInt(Single)Return the integer portion of a number.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberStrReturns a String representation of a number.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberVal(Char)Returns the numbers contained in a string as a numeric value of appropriate type.
Public methodStatic memberVal(Object)Returns the numbers contained in a string as a numeric value of appropriate type.
Public methodStatic memberVal(String)Returns the numbers contained in a string as a numeric value of appropriate type.
Top

This module supports the Visual Basic language keywords and run-time library members that convert decimal numbers to other bases, numbers to strings, strings to numbers, and one data type to another.

This example uses the Hex function to return the hexadecimal value of a number.


Dim TestHex As String
' Returns 5.
TestHex = Hex(5)
' Returns A.
TestHex = Hex(10)
' Returns 1CB.
TestHex = Hex(459)


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.