Export (0) Print
Expand All

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)

[StandardModuleAttribute]
public sealed 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<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 memberErrorToString()Returns 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 it 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 memberOct(Byte)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int16)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int32)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int64)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Object)Returns a string representing the octal value of a number.
Public methodStatic memberOct(SByte)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt16)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt32)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt64)Returns a string representing the octal value of a number.
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)


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft