Conversion Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
The Conversion module contains the procedures used to perform various conversion operations.
Inheritance Hierarchy
System.Object
Microsoft.VisualBasic.Conversion
Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
Syntax
'Declaration
<StandardModuleAttribute> _
Public NotInheritable Class Conversion
[StandardModuleAttribute]
public sealed class Conversion
The Conversion type exposes the following members.
Methods
Name | Description | |
---|---|---|
CTypeDynamic(Object, Type) | Converts an object to the specified type. | |
CTypeDynamic<TargetType>(Object) | Converts an object to the specified generic type. | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
ErrorToString() | Returns the error message that corresponds to a given error number. | |
ErrorToString(Int32) | Returns the error message that corresponds to a given error number. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
Fix(Decimal) | Return the integer portion of a number. | |
Fix(Double) | Return the integer portion of a number. | |
Fix(Int16) | Return the integer portion of a number. | |
Fix(Int32) | Return the integer portion of a number. | |
Fix(Int64) | Return the integer portion of a number. | |
Fix(Object) | Return the integer portion of a number. | |
Fix(Single) | Return the integer portion of a number. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Hex(Byte) | Returns a string representing the hexadecimal value of a number. | |
Hex(Int16) | Returns a string representing the hexadecimal value of a number. | |
Hex(Int32) | Returns a string representing the hexadecimal value of a number. | |
Hex(Int64) | Returns a string representing the hexadecimal value of a number. | |
Hex(Object) | Returns a string representing the hexadecimal value of a number. | |
Hex(SByte) | Returns a string representing the hexadecimal value of a number. | |
Hex(UInt16) | Returns a string representing the hexadecimal value of a number. | |
Hex(UInt32) | Returns a string representing the hexadecimal value of a number. | |
Hex(UInt64) | Returns a string representing the hexadecimal value of a number. | |
Int(Decimal) | Return the integer portion of a number. | |
Int(Double) | Return the integer portion of a number. | |
Int(Int16) | Return the integer portion of a number. | |
Int(Int32) | Return the integer portion of a number. | |
Int(Int64) | Return the integer portion of a number. | |
Int(Object) | Return the integer portion of a number. | |
Int(Single) | Return the integer portion of a number. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Str | Returns a String representation of a number. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Val(Char) | Returns the numbers contained in a string as a numeric value of appropriate type. | |
Val(Object) | Returns the numbers contained in a string as a numeric value of appropriate type. | |
Val(String) | Returns the numbers contained in a string as a numeric value of appropriate type. |
Top
Remarks
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.
Examples
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)
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.