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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

Parameters:

  • aValue: