Convert

Overview

Helper static class that converts a base data type to another base data type.

Location

  • Reference: Sugar
  • Namespace: Sugar

Class Methods


HexStringToByteArray

 

class method HexStringToByteArray(aData: not nullable String): array of Byte

 

static Byte[] HexStringToByteArray(String! aData)

 

static func HexStringToByteArray(_ aData: String) -> Byte...

 

static Byte[] HexStringToByteArray(String aData)

 

Shared Function HexStringToByteArray(aData As String) As Byte()

Parameters:

  • aData:

HexStringToInt32

 

class method HexStringToInt32(aValue: not nullable String): UInt32

 

static UInt32 HexStringToInt32(String! aValue)

 

static func HexStringToInt32(_ aValue: String) -> UInt32

 

static UInt32 HexStringToInt32(String aValue)

 

Shared Function HexStringToInt32(aValue As String) As UInt32

Parameters:

  • aValue:

HexStringToInt64

 

class method HexStringToInt64(aValue: not nullable String): UInt64

 

static UInt64 HexStringToInt64(String! aValue)

 

static func HexStringToInt64(_ aValue: String) -> UInt64

 

static UInt64 HexStringToInt64(String aValue)

 

Shared Function HexStringToInt64(aValue As String) As UInt64

Parameters:

  • aValue:

ToBinaryString

 

class method ToBinaryString(aValue: Int64; aWidth: Int32): not nullable String

 

static String! ToBinaryString(Int64 aValue, Int32 aWidth)

 

static func ToBinaryString(_ aValue: Int64, _ aWidth: Int32) -> String

 

static String ToBinaryString(Int64 aValue, Int32 aWidth)

 

Shared Function ToBinaryString(aValue As Int64, aWidth As Int32) As String

Parameters:

  • aValue:
  • aWidth:

ToBoolean (not nullable String): Boolean

Converts the value of the specified String to an equivalent Boolean value. Returns false when parameter is nil or Consts, returns true is equals to Consts.

 

class method ToBoolean(aValue: not nullable String): Boolean

 

static Boolean ToBoolean(String! aValue)

 

static func ToBoolean(_ aValue: String) -> Boolean

 

static Boolean ToBoolean(String aValue)

 

Shared Function ToBoolean(aValue As String) As Boolean

Parameters:

  • aValue: The String to convert.

ToBoolean (Byte): Boolean

Converts the value of the specified byte to an equivalent Boolean value.

 

class method ToBoolean(aValue: Byte): Boolean

 

static Boolean ToBoolean(Byte aValue)

 

static func ToBoolean(_ aValue: Byte) -> Boolean

 

static Boolean ToBoolean(Byte aValue)

 

Shared Function ToBoolean(aValue As Byte) As Boolean

Parameters:

  • aValue: The byte to convert.

ToBoolean (Double): Boolean

Converts the value of the specified Double to an equivalent Boolean value.

 

class method ToBoolean(aValue: Double): Boolean

 

static Boolean ToBoolean(Double aValue)

 

static func ToBoolean(_ aValue: Double) -> Boolean

 

static Boolean ToBoolean(Double aValue)

 

Shared Function ToBoolean(aValue As Double) As Boolean

Parameters:

  • aValue: The Double to convert.

ToBoolean (Int32): Boolean

Converts the value of the specified Int32 to an equivalent Boolean value.

 

class method ToBoolean(aValue: Int32): Boolean

 

static Boolean ToBoolean(Int32 aValue)

 

static func ToBoolean(_ aValue: Int32) -> Boolean

 

static Boolean ToBoolean(Int32 aValue)

 

Shared Function ToBoolean(aValue As Int32) As Boolean

Parameters:

  • aValue: The Int32 to convert.

ToBoolean (Int64): Boolean

Converts the value of the specified Int64 to an equivalent Boolean value.

 

class method ToBoolean(aValue: Int64): Boolean

 

static Boolean ToBoolean(Int64 aValue)

 

static func ToBoolean(_ aValue: Int64) -> Boolean

 

static Boolean ToBoolean(Int64 aValue)

 

Shared Function ToBoolean(aValue As Int64) As Boolean

Parameters:

  • aValue: The Int64 to convert.

ToByte (not nullable String): Byte

Converts the value of the specified String to an equivalent Byte value.

 

class method ToByte(aValue: not nullable String): Byte

 

static Byte ToByte(String! aValue)

 

static func ToByte(_ aValue: String) -> Byte

 

static Byte ToByte(String aValue)

 

Shared Function ToByte(aValue As String) As Byte

Parameters:

  • aValue: The String to convert.

ToByte (Boolean): Byte

 

class method ToByte(aValue: Boolean): Byte

 

static Byte ToByte(Boolean aValue)

 

static func ToByte(_ aValue: Boolean) -> Byte

 

static Byte ToByte(Boolean aValue)

 

Shared Function ToByte(aValue As Boolean) As Byte

Parameters:

  • aValue:

ToByte (Char): Byte

Converts the value of the specified Char to an equivalent Byte value.

 

class method ToByte(aValue: Char): Byte

 

static Byte ToByte(Char aValue)

 

static func ToByte(_ aValue: Char) -> Byte

 

static Byte ToByte(Char aValue)

 

Shared Function ToByte(aValue As Char) As Byte

Parameters:

  • aValue: The Char to convert.

ToByte (Double): Byte

Converts the value of the specified String to an equivalent Byte value.

 

class method ToByte(aValue: Double): Byte

 

static Byte ToByte(Double aValue)

 

static func ToByte(_ aValue: Double) -> Byte

 

static Byte ToByte(Double aValue)

 

Shared Function ToByte(aValue As Double) As Byte

Parameters:

  • aValue: The Double to convert.

ToByte (Int32): Byte

Converts the value of the specified Int32 to an equivalent Byte value.

 

class method ToByte(aValue: Int32): Byte

 

static Byte ToByte(Int32 aValue)

 

static func ToByte(_ aValue: Int32) -> Byte

 

static Byte ToByte(Int32 aValue)

 

Shared Function ToByte(aValue As Int32) As Byte

Parameters:

  • aValue: The Int32 to convert.

ToByte (Int64): Byte

Converts the value of the specified Int64 to an equivalent Byte value.

 

class method ToByte(aValue: Int64): Byte

 

static Byte ToByte(Int64 aValue)

 

static func ToByte(_ aValue: Int64) -> Byte

 

static Byte ToByte(Int64 aValue)

 

Shared Function ToByte(aValue As Int64) As Byte

Parameters:

  • aValue: The Int64 to convert.

ToChar (not nullable String): Char

Converts the value of the specified String to an equivalent Char value.

 

class method ToChar(aValue: not nullable String): Char

 

static Char ToChar(String! aValue)

 

static func ToChar(_ aValue: String) -> Char

 

static Char ToChar(String aValue)

 

Shared Function ToChar(aValue As String) As Char

Parameters:

  • aValue: The String to convert.

ToChar (Boolean): Char

 

class method ToChar(aValue: Boolean): Char

 

static Char ToChar(Boolean aValue)

 

static func ToChar(_ aValue: Boolean) -> Char

 

static Char ToChar(Boolean aValue)

 

Shared Function ToChar(aValue As Boolean) As Char

Parameters:

  • aValue:

ToChar (Byte): Char

Converts the value of the specified Byte to an equivalent Char value.

 

class method ToChar(aValue: Byte): Char

 

static Char ToChar(Byte aValue)

 

static func ToChar(_ aValue: Byte) -> Char

 

static Char ToChar(Byte aValue)

 

Shared Function ToChar(aValue As Byte) As Char

Parameters:

  • aValue: The Byte to convert.

ToChar (Int32): Char

Converts the value of the specified Int32 to an equivalent Char value.

 

class method ToChar(aValue: Int32): Char

 

static Char ToChar(Int32 aValue)

 

static func ToChar(_ aValue: Int32) -> Char

 

static Char ToChar(Int32 aValue)

 

Shared Function ToChar(aValue As Int32) As Char

Parameters:

  • aValue: The Int32 to convert.

ToChar (Int64): Char

Converts the value of the specified Int64 to an equivalent Char value.

 

class method ToChar(aValue: Int64): Char

 

static Char ToChar(Int64 aValue)

 

static func ToChar(_ aValue: Int64) -> Char

 

static Char ToChar(Int64 aValue)

 

Shared Function ToChar(aValue As Int64) As Char

Parameters:

  • aValue: The Int64 to convert.

ToDouble (not nullable String, Locale): Double

Converts the value of the specified String to an equivalent Double value.

 

class method ToDouble(aValue: not nullable String; aLocale: Locale): Double

 

static Double ToDouble(String! aValue, Locale aLocale)

 

static func ToDouble(_ aValue: String, _ aLocale: Locale) -> Double

 

static Double ToDouble(String aValue, Locale aLocale)

 

Shared Function ToDouble(aValue As String, aLocale As Locale) As Double

Parameters:

  • aValue: The String to convert.
  • aLocale:

ToDouble (Boolean): Double

 

class method ToDouble(aValue: Boolean): Double

 

static Double ToDouble(Boolean aValue)

 

static func ToDouble(_ aValue: Boolean) -> Double

 

static Double ToDouble(Boolean aValue)

 

Shared Function ToDouble(aValue As Boolean) As Double

Parameters:

  • aValue:

ToDouble (Byte): Double

Converts the value of the specified Byte to an equivalent Double value.

 

class method ToDouble(aValue: Byte): Double

 

static Double ToDouble(Byte aValue)

 

static func ToDouble(_ aValue: Byte) -> Double

 

static Double ToDouble(Byte aValue)

 

Shared Function ToDouble(aValue As Byte) As Double

Parameters:

  • aValue: The Byte to convert.

ToDouble (Int32): Double

Converts the value of the specified Int32 to an equivalent Double value.

 

class method ToDouble(aValue: Int32): Double

 

static Double ToDouble(Int32 aValue)

 

static func ToDouble(_ aValue: Int32) -> Double

 

static Double ToDouble(Int32 aValue)

 

Shared Function ToDouble(aValue As Int32) As Double

Parameters:

  • aValue: The Int32 to convert.

ToDouble (Int64): Double

Converts the value of the specified Int64 to an equivalent Double value.

 

class method ToDouble(aValue: Int64): Double

 

static Double ToDouble(Int64 aValue)

 

static func ToDouble(_ aValue: Int64) -> Double

 

static Double ToDouble(Int64 aValue)

 

Shared Function ToDouble(aValue As Int64) As Double

Parameters:

  • aValue: The Int64 to convert.

ToHexString (array of Byte): not nullable String

 

class method ToHexString(aData: array of Byte): not nullable String

 

static String! ToHexString(Byte[] aData)

 

static func ToHexString(_ aData: Byte...) -> String

 

static String ToHexString(Byte[] aData)

 

Shared Function ToHexString(aData As Byte()) As String

Parameters:

  • aData:

ToHexString (array of Byte, Int32): not nullable String

 

class method ToHexString(aData: array of Byte; aCount: Int32): not nullable String

 

static String! ToHexString(Byte[] aData, Int32 aCount)

 

static func ToHexString(_ aData: Byte..., _ aCount: Int32) -> String

 

static String ToHexString(Byte[] aData, Int32 aCount)

 

Shared Function ToHexString(aData As Byte(), aCount As Int32) As String

Parameters:

  • aData:
  • aCount:

ToHexString (array of Byte, Int32, Int32): not nullable String

 

class method ToHexString(aData: array of Byte; aOffset: Int32; aCount: Int32): not nullable String

 

static String! ToHexString(Byte[] aData, Int32 aOffset, Int32 aCount)

 

static func ToHexString(_ aData: Byte..., _ aOffset: Int32, _ aCount: Int32) -> String

 

static String ToHexString(Byte[] aData, Int32 aOffset, Int32 aCount)

 

Shared Function ToHexString(aData As Byte(), aOffset As Int32, aCount As Int32) As String

Parameters:

  • aData:
  • aOffset:
  • aCount:

ToHexString (Binary): not nullable String

 

class method ToHexString(aData: Binary): not nullable String

 

static String! ToHexString(Binary aData)

 

static func ToHexString(_ aData: Binary) -> String

 

static String ToHexString(Binary aData)

 

Shared Function ToHexString(aData As Binary) As String

Parameters:

  • aData:

ToHexString (UInt64, Int32): not nullable String

 

class method ToHexString(aValue: UInt64; aWidth: Int32): not nullable String

 

static String! ToHexString(UInt64 aValue, Int32 aWidth)

 

static func ToHexString(_ aValue: UInt64, _ aWidth: Int32) -> String

 

static String ToHexString(UInt64 aValue, Int32 aWidth)

 

Shared Function ToHexString(aValue As UInt64, aWidth As Int32) As String

Parameters:

  • aValue:
  • aWidth:

ToInt32 (not nullable String): Int32

Converts the value of the specified String to an equivalent Int32 value.

 

class method ToInt32(aValue: not nullable String): Int32

 

static Int32 ToInt32(String! aValue)

 

static func ToInt32(_ aValue: String) -> Int32

 

static Int32 ToInt32(String aValue)

 

Shared Function ToInt32(aValue As String) As Int32

Parameters:

  • aValue: The String to convert.

ToInt32 (Boolean): Int32

 

class method ToInt32(aValue: Boolean): Int32

 

static Int32 ToInt32(Boolean aValue)

 

static func ToInt32(_ aValue: Boolean) -> Int32

 

static Int32 ToInt32(Boolean aValue)

 

Shared Function ToInt32(aValue As Boolean) As Int32

Parameters:

  • aValue:

ToInt32 (Byte): Int32

Converts the value of the specified Byte to an equivalent Int32 value.

 

class method ToInt32(aValue: Byte): Int32

 

static Int32 ToInt32(Byte aValue)

 

static func ToInt32(_ aValue: Byte) -> Int32

 

static Int32 ToInt32(Byte aValue)

 

Shared Function ToInt32(aValue As Byte) As Int32

Parameters:

  • aValue: The Byte to convert.

ToInt32 (Char): Int32

Converts the value of the specified Char to an equivalent Int32 value.

 

class method ToInt32(aValue: Char): Int32

 

static Int32 ToInt32(Char aValue)

 

static func ToInt32(_ aValue: Char) -> Int32

 

static Int32 ToInt32(Char aValue)

 

Shared Function ToInt32(aValue As Char) As Int32

Parameters:

  • aValue: The Char to convert.

ToInt32 (Double): Int32

Converts the value of the specified Double to an equivalent Int32 value.

 

class method ToInt32(aValue: Double): Int32

 

static Int32 ToInt32(Double aValue)

 

static func ToInt32(_ aValue: Double) -> Int32

 

static Int32 ToInt32(Double aValue)

 

Shared Function ToInt32(aValue As Double) As Int32

Parameters:

  • aValue: The Double to convert.

ToInt32 (Int64): Int32

Converts the value of the specified Int64 to an equivalent Int32 value.

 

class method ToInt32(aValue: Int64): Int32

 

static Int32 ToInt32(Int64 aValue)

 

static func ToInt32(_ aValue: Int64) -> Int32

 

static Int32 ToInt32(Int64 aValue)

 

Shared Function ToInt32(aValue As Int64) As Int32

Parameters:

  • aValue: The Int64 to convert.

ToInt64 (not nullable String): Int64

Converts the value of the specified String to an equivalent Int64 value.

 

class method ToInt64(aValue: not nullable String): Int64

 

static Int64 ToInt64(String! aValue)

 

static func ToInt64(_ aValue: String) -> Int64

 

static Int64 ToInt64(String aValue)

 

Shared Function ToInt64(aValue As String) As Int64

Parameters:

  • aValue: The String to convert.

ToInt64 (Boolean): Int64

 

class method ToInt64(aValue: Boolean): Int64

 

static Int64 ToInt64(Boolean aValue)

 

static func ToInt64(_ aValue: Boolean) -> Int64

 

static Int64 ToInt64(Boolean aValue)

 

Shared Function ToInt64(aValue As Boolean) As Int64

Parameters:

  • aValue:

ToInt64 (Byte): Int64

Converts the value of the specified Byte to an equivalent Int64 value.

 

class method ToInt64(aValue: Byte): Int64

 

static Int64 ToInt64(Byte aValue)

 

static func ToInt64(_ aValue: Byte) -> Int64

 

static Int64 ToInt64(Byte aValue)

 

Shared Function ToInt64(aValue As Byte) As Int64

Parameters:

  • aValue: The Byte to convert.

ToInt64 (Char): Int64

Converts the value of the specified Char to an equivalent Int64 value.

 

class method ToInt64(aValue: Char): Int64

 

static Int64 ToInt64(Char aValue)

 

static func ToInt64(_ aValue: Char) -> Int64

 

static Int64 ToInt64(Char aValue)

 

Shared Function ToInt64(aValue As Char) As Int64

Parameters:

  • aValue: The Char to convert.

ToInt64 (Double): Int64

Converts the value of the specified Double to an equivalent Int64 value.

 

class method ToInt64(aValue: Double): Int64

 

static Int64 ToInt64(Double aValue)

 

static func ToInt64(_ aValue: Double) -> Int64

 

static Int64 ToInt64(Double aValue)

 

Shared Function ToInt64(aValue As Double) As Int64

Parameters:

  • aValue: The Double to convert.

ToInt64 (Int32): Int64

Converts the value of the specified Int32 to an equivalent Int64 value.

 

class method ToInt64(aValue: Int32): Int64

 

static Int64 ToInt64(Int32 aValue)

 

static func ToInt64(_ aValue: Int32) -> Int64

 

static Int64 ToInt64(Int32 aValue)

 

Shared Function ToInt64(aValue As Int32) As Int64

Parameters:

  • aValue: The Int32 to convert.

ToOctalString

 

class method ToOctalString(aValue: Int64; aWidth: Int32): not nullable String

 

static String! ToOctalString(Int64 aValue, Int32 aWidth)

 

static func ToOctalString(_ aValue: Int64, _ aWidth: Int32) -> String

 

static String ToOctalString(Int64 aValue, Int32 aWidth)

 

Shared Function ToOctalString(aValue As Int64, aWidth As Int32) As String

Parameters:

  • aValue:
  • aWidth:

ToString (Boolean): not nullable String

 

class method ToString(aValue: Boolean): not nullable String

 

static String! ToString(Boolean aValue)

 

static func ToString(_ aValue: Boolean) -> String

 

static String ToString(Boolean aValue)

 

Shared Function ToString(aValue As Boolean) As String

Parameters:

  • aValue:

ToString (Byte, Int32): not nullable String

Converts the value of the specified Byte to an equivalent String value.

 

class method ToString(aValue: Byte; aBase: Int32): not nullable String

 

static String! ToString(Byte aValue, Int32 aBase)

 

static func ToString(_ aValue: Byte, _ aBase: Int32) -> String

 

static String ToString(Byte aValue, Int32 aBase)

 

Shared Function ToString(aValue As Byte, aBase As Int32) As String

Parameters:

  • aValue: The Byte to convert.
  • aBase:

ToString (Char): not nullable String

Converts the value of the specified Char to an equivalent String value.

 

class method ToString(aValue: Char): not nullable String

 

static String! ToString(Char aValue)

 

static func ToString(_ aValue: Char) -> String

 

static String ToString(Char aValue)

 

Shared Function ToString(aValue As Char) As String

Parameters:

  • aValue: The Char to convert.

ToString (Double, Int32, Locale): not nullable String

Converts the value of the specified Double to an equivalent String value.

 

class method ToString(aValue: Double; aDigitsAfterDecimalPoint: Int32; aLocale: Locale): not nullable String

 

static String! ToString(Double aValue, Int32 aDigitsAfterDecimalPoint, Locale aLocale)

 

static func ToString(_ aValue: Double, _ aDigitsAfterDecimalPoint: Int32, _ aLocale: Locale) -> String

 

static String ToString(Double aValue, Int32 aDigitsAfterDecimalPoint, Locale aLocale)

 

Shared Function ToString(aValue As Double, aDigitsAfterDecimalPoint As Int32, aLocale As Locale) As String

Parameters:

  • aValue: The Double to convert.
  • aDigitsAfterDecimalPoint:
  • aLocale:

ToString (Int32, Int32): not nullable String

Converts the value of the specified Int32 to an equivalent String value.

 

class method ToString(aValue: Int32; aBase: Int32): not nullable String

 

static String! ToString(Int32 aValue, Int32 aBase)

 

static func ToString(_ aValue: Int32, _ aBase: Int32) -> String

 

static String ToString(Int32 aValue, Int32 aBase)

 

Shared Function ToString(aValue As Int32, aBase As Int32) As String

Parameters:

  • aValue: The Int32 to convert.
  • aBase:

ToString (Int64, Int32): not nullable String

Converts the value of the specified Int64 to an equivalent String value.

 

class method ToString(aValue: Int64; aBase: Int32): not nullable String

 

static String! ToString(Int64 aValue, Int32 aBase)

 

static func ToString(_ aValue: Int64, _ aBase: Int32) -> String

 

static String ToString(Int64 aValue, Int32 aBase)

 

Shared Function ToString(aValue As Int64, aBase As Int32) As String

Parameters:

  • aValue: The Int64 to convert.
  • aBase:

ToString (Object): not nullable String

Converts the value of the specified Double to an equivalent String value.

 

class method ToString(aValue: Object): not nullable String

 

static String! ToString(Object aValue)

 

static func ToString(_ aValue: Object) -> String

 

static String ToString(Object aValue)

 

Shared Function ToString(aValue As Object) As String

Parameters:

  • aValue: The Object to convert.

ToStringInvariant

 

class method ToStringInvariant(aValue: Double; aDigitsAfterDecimalPoint: Int32): not nullable String

 

static String! ToStringInvariant(Double aValue, Int32 aDigitsAfterDecimalPoint)

 

static func ToStringInvariant(_ aValue: Double, _ aDigitsAfterDecimalPoint: Int32) -> String

 

static String ToStringInvariant(Double aValue, Int32 aDigitsAfterDecimalPoint)

 

Shared Function ToStringInvariant(aValue As Double, aDigitsAfterDecimalPoint As Int32) As String

Parameters:

  • aValue:
  • aDigitsAfterDecimalPoint:

TryToDouble

 

class method TryToDouble(aValue: not nullable String; aLocale: Locale): nullable Double

 

static Double? TryToDouble(String! aValue, Locale aLocale)

 

static func TryToDouble(_ aValue: String, _ aLocale: Locale) -> Double!

 

static Double TryToDouble(String aValue, Locale aLocale)

 

Shared Function TryToDouble(aValue As String, aLocale As Locale) As Double?

Parameters:

  • aValue:
  • aLocale:

TryToInt32

 

class method TryToInt32(aValue: not nullable String): nullable Int32

 

static Int32? TryToInt32(String! aValue)

 

static func TryToInt32(_ aValue: String) -> Int32!

 

static Int32 TryToInt32(String aValue)

 

Shared Function TryToInt32(aValue As String) As Int32?

Parameters:

  • aValue:

TryToInt64

 

class method TryToInt64(aValue: not nullable String): nullable Int64

 

static Int64? TryToInt64(String! aValue)

 

static func TryToInt64(_ aValue: String) -> Int64!

 

static Int64 TryToInt64(String aValue)

 

Shared Function TryToInt64(aValue As String) As Int64?

Parameters:

  • aValue: