String

extension String
extension String: Identifier

Codable String Conversion Extension.

  • int

    Converts the given String to an Int?.

    Declaration

    Swift

    public var int: Int? { get }
  • Converts the given String to a Int8?.

    Declaration

    Swift

    public var int8: Int8? { get }
  • Converts the given String to a Int16?.

    Declaration

    Swift

    public var int16: Int16? { get }
  • Converts the given String to a Int32?.

    Declaration

    Swift

    public var int32: Int32? { get }
  • Converts the given String to a Int64?.

    Declaration

    Swift

    public var int64: Int64? { get }
  • Converts the given String to a UInt?.

    Declaration

    Swift

    public var uInt: UInt? { get }
  • Converts the given String to a UInt8?.

    Declaration

    Swift

    public var uInt8: UInt8? { get }
  • Converts the given String to a UInt16?.

    Declaration

    Swift

    public var uInt16: UInt16? { get }
  • Converts the given String to a UInt32?.

    Declaration

    Swift

    public var uInt32: UInt32? { get }
  • Converts the given String to a UInt64?.

    Declaration

    Swift

    public var uInt64: UInt64? { get }
  • Converts the given String to a Float?.

    Declaration

    Swift

    public var float: Float? { get }
  • Converts the given String to a Double?.

    Declaration

    Swift

    public var double: Double? { get }
  • Converts the given String to a Bool?.

    Declaration

    Swift

    public var boolean: Bool? { get }
  • Converts the given String to a String.

    Declaration

    Swift

    public var string: String { get }
  • Converts the given String to an [Int]?.

    Declaration

    Swift

    public var intArray: [Int]? { get }
  • Converts the given String to an [Int8]?.

    Declaration

    Swift

    public var int8Array: [Int8]? { get }
  • Converts the given String to an [Int16]?.

    Declaration

    Swift

    public var int16Array: [Int16]? { get }
  • Converts the given String to an [Int32]?.

    Declaration

    Swift

    public var int32Array: [Int32]? { get }
  • Converts the given String to an [Int64]?.

    Declaration

    Swift

    public var int64Array: [Int64]? { get }
  • Converts the given String to an [UInt]?.

    Declaration

    Swift

    public var uIntArray: [UInt]? { get }
  • Converts the given String to an [UInt8]?.

    Declaration

    Swift

    public var uInt8Array: [UInt8]? { get }
  • Converts the given String to an [UInt16]?.

    Declaration

    Swift

    public var uInt16Array: [UInt16]? { get }
  • Converts the given String to an [UInt32]?.

    Declaration

    Swift

    public var uInt32Array: [UInt32]? { get }
  • Converts the given String to an [UInt64]?.

    Declaration

    Swift

    public var uInt64Array: [UInt64]? { get }
  • Converts the given String to a [Float]?.

    Declaration

    Swift

    public var floatArray: [Float]? { get }
  • Converts the given String to a [Double]?.

    Declaration

    Swift

    public var doubleArray: [Double]? { get }
  • Converts the given String to a [Bool]?.

    Declaration

    Swift

    public var booleanArray: [Bool]? { get }
  • Converts the given String to a [String].

    Declaration

    Swift

    public var stringArray: [String] { get }
  • Method used to decode a string into the given type T.

    Declaration

    Swift

    public func decodable<T>(_ type: T.Type) -> T? where T : Decodable

    Parameters

    type

    The Decodable type to convert the string into.

    Return Value

    The Date? object. Some on success / nil on failure.

  • Converts the given String to a Date?.

    Declaration

    Swift

    public func date(_ formatter: DateFormatter) -> Date?

    Parameters

    formatter

    The designated DateFormatter to convert the string with.

    Return Value

    The Date? object. Some on success / nil on failure.

  • Converts the given String to a [Date]?.

    Declaration

    Swift

    public func dateArray(_ formatter: DateFormatter) -> [Date]?

    Parameters

    formatter

    The designated DateFormatter to convert the string with.

    Return Value

    The [Date]? object. Some on success / nil on failure.

  • Converts the given String to a [Date]? object using the dateDecodingStrategy supplied.

    Declaration

    Swift

    public func dateArray(decoderStrategy: JSONDecoder.DateDecodingStrategy = .formatted(Coder.defaultDateFormatter), decoder: Decoder? = nil) -> [Date]?

    Parameters

    formatter

    The designated DateFormatter to convert the string with.

    decoderStrategy

    The JSON.dateDecodingStrategy that should be used to decode the specifed Date. Default is set to .formatted with default dateFormatter.

    decoder

    The Decoder parameter is only used for the custom strategy.

    Return Value

    The [Date]? object. Some on success / nil on failure.

  • Creates a string identifier from a given string value.

    Declaration

    Swift

    public init(value: String)
  • The string representation of the identifier.

    Declaration

    Swift

    public var value: String { get }