Interfaces

interface Formattable

public interface Formattable {
    func format(fmt: String): String
}

Description: Defines the formatting function, that is, converting an instance of a specified type to a string in the corresponding format according to the formatting parameter.

For details about the formatting parameter, see Overview in the convert package.

For other types, this interface can be implemented to provide the formatting function.

func format(String)

func format(fmt: String): String

Description: Formats the current instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current instance is formatted

extend Float16 <: Formattable

extend Float16 <: Formattable

Description: Extends the Formattable interface for Float16 to convert a Float16 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Float16 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Float16 instance is formatted

Throws:

extend Float32 <: Formattable

extend Float32 <: Formattable

Description: Extends the Formattable interface for Float32 to convert a Float32 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Float32 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Float32 instance is formatted

Throws:

extend Float64 <: Formattable

extend Float64 <: Formattable

Description: Extends the Formattable interface for Float64 to convert a Float64 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Float64 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Float64 instance is formatted

Throws:

extend Int16 <: Formattable

extend Int16 <: Formattable

Description: Extends the Formattable interface for Int16 to convert an Int16 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Int16 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Int16 instance is formatted

Throws:

extend Int32 <: Formattable

extend Int32 <: Formattable

Description: Extends the Formattable interface for Int32 to convert an Int32 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Int32 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Int32 instance is formatted

Throws:

extend Int64 <: Formattable

extend Int64 <: Formattable

Description: Extends the Formattable interface for Int64 to convert an Int64 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Int64 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Int64 instance is formatted

Throws:

extend Int8 <: Formattable

extend Int8 <: Formattable

Description: Extends the Formattable interface for Int8 to convert an Int8 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Int8 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Int8 instance is formatted

Throws:

extend Rune <: Formattable

extend Rune <: Formattable

Description: Extends the Formattable interface for Rune to convert a Rune instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current Rune instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current Rune instance is formatted

Throws:

extend UInt16 <: Formattable

extend UInt16 <: Formattable

Description: Extends the Formattable interface for UInt16 to convert a UInt16 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current UInt16 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current UInt16 instance is formatted

Throws:

extend UInt32 <: Formattable

extend UInt32 <: Formattable

Description: Extends the Formattable interface for UInt32 to convert a UInt32 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current UInt32 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current UInt32 instance is formatted

Throws:

extend UInt64 <: Formattable

extend UInt64 <: Formattable

Description: Extends the Formattable interface for UInt64 to convert a UInt64 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current UInt64 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current UInt64 instance is formatted

Throws:

extend UInt8 <: Formattable

extend UInt8 <: Formattable

Description: Extends the Formattable interface for UInt8 to convert a UInt8 instance to a formatted string.

Parent types:

func format(String)

public func format(fmt: String): String

Description: Formats the current UInt8 instance into a string in the corresponding format according to the formatting parameter.

Parameters:

  • fmt: String: formatting parameter

Returns:

  • String: string obtained after the current UInt8 instance is formatted

Throws:

interface Parsable<T>

public interface Parsable<T> {
    static func parse(value: String): T
    static func tryParse(value: String): Option<T>
}

Description: Provides unified methods to parse strings to specific types.

This interface provides two methods: parse and tryParse. The parse method throws an exception when parsing fails. The tryParse method returns the result encapsulated with Option. If parsing fails, the tryParse method returns None. In this package, the basic types, such as Bool, Rune, Float16, and Int64, have implemented this interface. This interface can be used to convert strings to these types.

static func parse(String)

static func parse(value: String): T

Description: Parses a string into a specific type.

Parameters:

  • value: String: string to be parsed

Returns:

  • T: value after conversion

static func tryParse(String)

static func tryParse(value: String): Option<T>

Description: Parses a string into a specific type.

Parameters:

  • value: String: string to be parsed

Returns:

  • Option<T>: value after conversion. If the conversion fails, Option<T>.None is returned.

extend Bool <: Parsable<Bool>

extend Bool <: Parsable<Bool>

Description: Implements related operation functions of converting a Bool literal string to a Bool value.

Parent types:

static func parse(String)

public static func parse(data: String): Bool

Description: Converts a Bool literal string to a Bool value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

static func tryParse(String)

public static func tryParse(data: String): Option<Bool>

Description: Converts a Bool literal string to an Option<Bool> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Float16 <: Parsable<Float16>

extend Float16 <: Parsable<Float16>

Description: Implements related operation functions of converting a Float16 literal string to a Float16 value.

Parent types:

static func parse(String)

public static func parse(data: String): Float16

Description: Converts a Float16 literal string to a Float16 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string does not comply with the floating-point number syntax, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Float16>

Description: Converts a Float16 literal string to an Option<Float16> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Float32 <: Parsable<Float32>

extend Float32 <: Parsable<Float32>

Description: Implements related operation functions of converting a Float32 literal string to a Float32 value.

Parent types:

static func parse(String)

public static func parse(data: String): Float32

Description: Converts a Float32 literal string to a Float32 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string does not comply with the floating-point number syntax, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Float32>

Description: Converts a Float32 literal string to an Option<Float32> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Float64 <: Parsable<Float64>

extend Float64 <: Parsable<Float64>

Description: Implements related operation functions of converting a Float64 literal string to a Float64 value.

Parent types:

static func parse(String)

public static func parse(data: String): Float64

Description: Converts a Float64 literal string to a Float64 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string does not comply with the floating-point number syntax, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Float64>

Description: Converts a Float64 literal string to an Option<Float64> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Int16 <: Parsable<Int16>

extend Int16 <: Parsable<Int16>

Description: Implements related operation functions of converting an Int16 literal string to an Int16 value.

Parent types:

static func parse(String)

public static func parse(data: String): Int16

Description: Converts an Int16 literal string to an Int16 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is +, the conversion fails, the value after conversion exceeds the range of Int16, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Int16>

Description: Converts an Int16 literal string to an Option<Int16> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Int32 <: Parsable<Int32>

extend Int32 <: Parsable<Int32>

Description: Implements related operation functions of converting an Int32 literal string to an Int32 value.

Parent types:

static func parse(String)

public static func parse(data: String): Int32

Description: Converts an Int32 literal string to an Int32 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is +, the conversion fails, the value after conversion exceeds the range of Int32, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Int32>

Description: Converts an Int32 literal string to an Option<Int32> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Int64 <: Parsable<Int64>

extend Int64 <: Parsable<Int64>

Description: Implements related operation functions of converting an Int64 literal string to an Int64 value.

Parent types:

static func parse(String)

public static func parse(data: String): Int64

Description: Converts an Int64 literal string to an Int64 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is +, the conversion fails, the value after conversion exceeds the range of Int64, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Int64>

Description: Converts an Int64 literal string to an Option<Int64> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Int8 <: Parsable<Int8>

extend Int8 <: Parsable<Int8>

Description: Implements related operation functions of converting an Int8 literal string to an Int8 value.

Parent types:

static func parse(String)

public static func parse(data: String): Int8

Description: Converts an Int8 literal string to an Int8 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is +, the conversion fails, the value after conversion exceeds the range of Int8, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Int8>

Description: Converts an Int8 literal string to an Option<Int8> value.

Parameters:

  • data: String: string to be converted

Returns:

extend Rune <: Parsable<Rune>

extend Rune <: Parsable<Rune>

Description: Implements related operation functions of converting a Rune literal string to a Rune value.

Parent types:

static func parse(String)

public static func parse(data: String): Rune

Description: Converts a Rune literal string to a Rune value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the conversion fails, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<Rune>

Description: Converts a Rune literal string to an Option<Rune> value.

Parameters:

  • data: String: string to be converted

Returns:

extend UInt16 <: Parsable<UInt16>

extend UInt16 <: Parsable<UInt16>

Description: Implements related operation functions of converting a UInt16 literal string to a UInt16 value.

Parent types:

static func parse(String)

public static func parse(data: String): UInt16

Description: Converts a UInt16 literal string to a UInt16 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is + or -, the conversion fails, the value after conversion exceeds the range of UInt16, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<UInt16>

Description: Converts a UInt16 literal string to an Option<UInt16> value.

Parameters:

  • data: String: string to be converted

Returns:

extend UInt32 <: Parsable<UInt32>

extend UInt32 <: Parsable<UInt32>

Description: Implements related operation functions of converting a UInt32 literal string to a UInt32 value.

Parent types:

static func parse(String)

public static func parse(data: String): UInt32

Description: Converts a UInt32 literal string to a UInt32 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is + or -, the conversion fails, the value after conversion exceeds the range of UInt32, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<UInt32>

Description: Converts a UInt32 literal string to an Option<UInt32> value.

Parameters:

  • data: String: string to be converted

Returns:

extend UInt64 <: Parsable<UInt64>

extend UInt64 <: Parsable<UInt64>

Description: Implements related operation functions of converting a UInt64 literal string to a UInt64 value.

Parent types:

static func parse(String)

public static func parse(data: String): UInt64

Description: Converts a UInt64 literal string to a UInt64 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is + or -, the conversion fails, the value after conversion exceeds the range of UInt64, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<UInt64>

Description: Converts a UInt64 literal string to an Option<UInt64> value.

Parameters:

  • data: String: string to be converted

Returns:

extend UInt8 <: Parsable<UInt8>

extend UInt8 <: Parsable<UInt8>

Description: Implements related operation functions of converting a UInt8 literal string to a UInt8 value.

Parent types:

static func parse(String)

public static func parse(data: String): UInt8

Description: Converts a UInt8 literal string to a UInt8 value.

Parameters:

  • data: String: string to be converted

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the first character of the string is + or -, the conversion fails, the value after conversion exceeds the range of UInt8, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String)

public static func tryParse(data: String): Option<UInt8>

Description: Converts a UInt8 literal string to an Option<UInt8> value.

Parameters:

  • data: String: string to be converted

Returns:

interface RadixConvertible<T>

public interface RadixConvertible<T> {

    static func parse(value: String, radix!: Int): T

    static func tryParse(value: String, radix!: Int): Option<T>

    func toString(radix!: Int): String
}

Description: Provides unified methods to parse strings in specified numeral systems into specific types.

Numeral systems are specified by parameters instead of string prefixes. The numbers represented with numeral systems must fall in a range from binary numbers to base-36 numbers. Otherwise, an exception is thrown. Representations exceeding the decimal system follow alphabetical order in uppercase or lowercase letters, that is, 10 digits + 26 letters = base-36 system. An Int-type string can start with + or -, which can be processed to start with + if not starting with + or -. A UInt-type string can start with +, with an exception thrown if starting with -. Strings in specified numeral systems are returned. Representations exceeding the decimal system follow alphabetical order in lowercase letters, that is, 10 digits + 26 lowercase letters = base-36 system.

This interface provides two methods: parse and tryParse. The parse method throws an exception when parsing fails. The tryParse method returns the result encapsulated with Option. If parsing fails, the tryParse method returns None. In this package, this interface has been implemented for basic types such as Int64 and UInt64, and can be used to convert strings to these types.

static func parse(String, Int)

static func parse(value: String, radix!: Int): T

Description: Parses a string in a specified numeral system into a specific type.

Parameters:

  • value: String: string to be parsed
  • radix!: Int: specified numeral system

Returns:

  • T: value after conversion

static func tryParse(String, Int)

static func tryParse(value: String, radix!: Int): Option<T>

Description: Parses a string in a specified numeral system into a specific type.

Parameters:

  • value: String: string to be parsed
  • radix!: Int: specified numeral system

Returns:

  • Option<T>: value after conversion. If the conversion fails, Option<T>.None is returned.

func toString(Int)

func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

extend Int8 <: RadixConvertible<Int8>

extend Int8 <: RadixConvertible<Int8>

Description: Implements related operation functions of converting an Int8 literal string to an Int8 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): Int8

Description: Converts an Int8 literal string to an Int8 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the value after conversion exceeds the range of Int8, the string contains an invalid UTF-8 character, or the conversion fails, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<Int8>

Description: Converts an Int8 literal string to an Option<Int8> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend Int16 <: RadixConvertible<Int16>

extend Int16 <: RadixConvertible<Int16>

Description: Implements related operation functions of converting an Int16 literal string to an Int16 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): Int16

Description: Converts an Int16 literal string to an Int16 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the value after conversion exceeds the range of Int16, the string contains an invalid UTF-8 character, or the conversion fails, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<Int16>

Description: Converts an Int16 literal string to an Option<Int16> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend Int32 <: RadixConvertible<Int32>

extend Int32 <: RadixConvertible<Int32>

Description: Implements related operation functions of converting an Int32 literal string to an Int32 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): Int32

Description: Converts an Int32 literal string to an Int32 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the value after conversion exceeds the range of Int32, the string contains an invalid UTF-8 character, or the conversion fails, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<Int32>

Description: Converts an Int32 literal string to an Option<Int32> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend Int64 <: RadixConvertible<Int64>

extend Int64 <: RadixConvertible<Int64>

Description: Implements related operation functions of converting an Int64 literal string to an Int64 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): Int64

Description: Converts an Int64 literal string to an Int64 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the value after conversion exceeds the range of Int64, the string contains an invalid UTF-8 character, or the conversion fails, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<Int64>

Description: Converts an Int64 literal string to an Option<Int64> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend UInt8 <: RadixConvertible<UInt8>

extend UInt8 <: RadixConvertible<UInt8>

Description: Implements related operation functions of converting a UInt8 literal string to a UInt8 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): UInt8

Description: Converts a UInt8 literal string to a UInt8 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the string starts with -, the value after conversion exceeds the range of UInt8, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<UInt8>

Description: Converts a UInt8 literal string to an Option<UInt8> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend UInt16 <: RadixConvertible<UInt16>

extend UInt16 <: RadixConvertible<UInt16>

Description: Implements related operation functions of converting a UInt16 literal string to a UInt16 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): UInt16

Description: Converts a UInt16 literal string to a UInt16 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the string starts with -, the value after conversion exceeds the range of UInt16, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<UInt16>

Description: Converts a UInt16 literal string to an Option<UInt16> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend UInt32 <: RadixConvertible<UInt32>

extend UInt32 <: RadixConvertible<UInt32>

Description: Implements related operation functions of converting a UInt32 literal string to a UInt32 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): UInt32

Description: Converts a UInt32 literal string to a UInt32 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the string starts with -, the value after conversion exceeds the range of UInt32, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<UInt32>

Description: Converts a UInt32 literal string to an Option<UInt32> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws:

extend UInt64 <: RadixConvertible<UInt64>

extend UInt64 <: RadixConvertible<UInt64>

Description: Implements related operation functions of converting a UInt64 literal string to a UInt64 value.

Parent types:

static func parse(String, Int)

public static func parse(value: String, radix!: Int): UInt64

Description: Converts a UInt64 literal string to a UInt64 value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

Throws:

  • IllegalArgumentException: If the string is empty, the numeral system exceeds the range, the string starts with -, the value after conversion exceeds the range of UInt64, or the string contains an invalid UTF-8 character, this exception is thrown.

static func tryParse(String, Int)

public static func tryParse(value: String, radix!: Int): Option<UInt64>

Description: Converts a UInt64 literal string to an Option<UInt64> value.

Parameters:

  • value: String: string to be converted
  • radix!: Int: specified numeral system

Returns:

func toString(Int)

public func toString(radix!: Int): String

Description: Returns a string in a specified numeral system.

Parameters:

  • radix!: Int: specified numeral system

Returns:

  • String: string in the specified numeral system

Throws: