Operator: !=

``` operator != { associativity precedence }```

Declarations

func !=(_: (), rhs: ())

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

All arity zero tuples are equal.

Parameters: lhs: An empty tuple. rhs: An empty tuple.

Declaration

`func !=(lhs: (), rhs: ()) -> Bool`
func !=(_: Any.Type?, t1: Any.Type?)

Returns a Boolean value indicating whether two types are not identical.

Parameters: t0: A type to compare. t1: Another type to compare. Returns: `true` if one, but not both, of `t0` and `t1` are `nil`, or if they represent different types; otherwise, `false`.

Declaration

`func !=(t0: Any.Type?, t1: Any.Type?) -> Bool`
func != <A, B, C, D, E, F>(_: (A, B, C, D, E, F), rhs: (A, B, C, D, E, F))

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 6 components:

``````let a = ("a", 1, 2, 3, 4, 5)
let b = ("a", 1, 2, 3, 4, 5)
print(a != b)
// Prints "false"

let c = ("a", 1, 2, 3, 4, 6)
print(a != c)
// Prints "true"``````

Parameters: lhs: A tuple of `Equatable` elements. rhs: Another tuple of elements of the same type as `lhs`.

Declaration

`func !=<A, B, C, D, E, F>(lhs: (A, B, C, D, E, F), rhs: (A, B, C, D, E, F)) -> Bool where A : Equatable, B : Equatable, C : Equatable, D : Equatable, E : Equatable, F : Equatable`
func != <A, B, C, D, E>(_: (A, B, C, D, E), rhs: (A, B, C, D, E))

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 5 components:

``````let a = ("a", 1, 2, 3, 4)
let b = ("a", 1, 2, 3, 4)
print(a != b)
// Prints "false"

let c = ("a", 1, 2, 3, 5)
print(a != c)
// Prints "true"``````

Parameters: lhs: A tuple of `Equatable` elements. rhs: Another tuple of elements of the same type as `lhs`.

Declaration

`func !=<A, B, C, D, E>(lhs: (A, B, C, D, E), rhs: (A, B, C, D, E)) -> Bool where A : Equatable, B : Equatable, C : Equatable, D : Equatable, E : Equatable`
func != <A, B, C, D>(_: (A, B, C, D), rhs: (A, B, C, D))

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 4 components:

``````let a = ("a", 1, 2, 3)
let b = ("a", 1, 2, 3)
print(a != b)
// Prints "false"

let c = ("a", 1, 2, 4)
print(a != c)
// Prints "true"``````

Parameters: lhs: A tuple of `Equatable` elements. rhs: Another tuple of elements of the same type as `lhs`.

Declaration

`func !=<A, B, C, D>(lhs: (A, B, C, D), rhs: (A, B, C, D)) -> Bool where A : Equatable, B : Equatable, C : Equatable, D : Equatable`
func != <A, B, C>(_: (A, B, C), rhs: (A, B, C))

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 3 components:

``````let a = ("a", 1, 2)
let b = ("a", 1, 2)
print(a != b)
// Prints "false"

let c = ("a", 1, 3)
print(a != c)
// Prints "true"``````

Parameters: lhs: A tuple of `Equatable` elements. rhs: Another tuple of elements of the same type as `lhs`.

Declaration

`func !=<A, B, C>(lhs: (A, B, C), rhs: (A, B, C)) -> Bool where A : Equatable, B : Equatable, C : Equatable`
func != <A, B>(_: (A, B), rhs: (A, B))

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 2 components:

``````let a = ("a", 1)
let b = ("a", 1)
print(a != b)
// Prints "false"

let c = ("a", 2)
print(a != c)
// Prints "true"``````

Parameters: lhs: A tuple of `Equatable` elements. rhs: Another tuple of elements of the same type as `lhs`.

Declaration

`func !=<A, B>(lhs: (A, B), rhs: (A, B)) -> Bool where A : Equatable, B : Equatable`
func != <T>(_: T, rhs: T)

Returns a Boolean value indicating whether the two arguments are not equal.

Parameters: lhs: A raw-representable instance. rhs: A second raw-representable instance.

Declaration

`func !=<T>(lhs: T, rhs: T) -> Bool where T : Equatable, T : RawRepresentable, T.RawValue : Equatable`
func != <T>(_: T, rhs: T)

Returns a Boolean value indicating whether the two arguments are not equal.

Parameters: lhs: A raw-representable instance. rhs: A second raw-representable instance.

Declaration

`func !=<T>(lhs: T, rhs: T) -> Bool where T : RawRepresentable, T.RawValue : Equatable`
func !=(_: [[Element].Element], rhs: [[Element].Element])

Returns a Boolean value indicating whether two arrays are not equal.

Two arrays are equal if they contain the same elements in the same order. You can use the not-equal-to operator (`!=`) to compare any two arrays that store the same, `Equatable`-conforming element type.

Parameters: lhs: An array to compare. rhs: Another array to compare.

Declaration

`func !=(lhs: [[Element].Element], rhs: [[Element].Element]) -> Bool`

Declared In

`Array`, `Equatable`
func !=(_: [Key : Value], rhs: [Key : Value])

Declaration

`func !=(lhs: [Key : Value], rhs: [Key : Value]) -> Bool`

Declared In

`Dictionary`, `Equatable`
func !=(_: _OptionalNilComparisonType, rhs: Wrapped?)

Returns a Boolean value indicating whether the right-hand-side argument is not `nil`.

You can use this not-equal-to operator (`!=`) to test whether an optional instance is not `nil` even when the wrapped value's type does not conform to the `Equatable` protocol.

The following example declares the `stream` variable as an optional instance of a hypothetical `DataStream` type. Although `DataStream` is not an `Equatable` type, this operator allows checking whether `stream` wraps a value and is therefore not `nil`.

``````var stream: DataStream? = fetchDataStream()
if nil != stream {
print("The data stream has been configured.")
}
// Prints "The data stream has been configured."``````

Parameters: lhs: A `nil` literal. rhs: A value to compare to `nil`.

Declaration

`func !=(lhs: _OptionalNilComparisonType, rhs: Wrapped?) -> Bool`
func !=(_: ArraySlice<ArraySlice<Element>.Element>, rhs: ArraySlice<ArraySlice<Element>.Element>)

Returns a Boolean value indicating whether two arrays are not equal.

Two arrays are equal if they contain the same elements in the same order. You can use the not-equal-to operator (`!=`) to compare any two arrays that store the same, `Equatable`-conforming element type.

Parameters: lhs: An array to compare. rhs: Another array to compare.

Declaration

`func !=(lhs: ArraySlice<ArraySlice<Element>.Element>, rhs: ArraySlice<ArraySlice<Element>.Element>) -> Bool`

Declared In

`ArraySlice`, `Equatable`
func !=(_: ContiguousArray<ContiguousArray<Element>.Element>, rhs: ContiguousArray<ContiguousArray<Element>.Element>)

Returns a Boolean value indicating whether two arrays are not equal.

Two arrays are equal if they contain the same elements in the same order. You can use the not-equal-to operator (`!=`) to compare any two arrays that store the same, `Equatable`-conforming element type.

Parameters: lhs: An array to compare. rhs: Another array to compare.

Declaration

`func !=(lhs: ContiguousArray<ContiguousArray<Element>.Element>, rhs: ContiguousArray<ContiguousArray<Element>.Element>) -> Bool`

Declared In

`ContiguousArray`, `Equatable`
func !=(_: Int, rhs: Int)

Declaration

`func !=(lhs: Int, rhs: Int) -> Bool`

Declared In

`Int`, `FixedWidthInteger`
func !=(_: Int8, rhs: Int8)

Declaration

`func !=(lhs: Int8, rhs: Int8) -> Bool`

Declared In

`Int8`, `FixedWidthInteger`
func !=(_: Int16, rhs: Int16)

Declaration

`func !=(lhs: Int16, rhs: Int16) -> Bool`

Declared In

`Int16`, `FixedWidthInteger`
func !=(_: Int32, rhs: Int32)

Declaration

`func !=(lhs: Int32, rhs: Int32) -> Bool`

Declared In

`Int32`, `FixedWidthInteger`
func !=(_: Int64, rhs: Int64)

Declaration

`func !=(lhs: Int64, rhs: Int64) -> Bool`

Declared In

`Int64`, `FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`BinaryFloatingPoint`, `Equatable`, `Comparable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Hashable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Comparable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Strideable`, `Comparable`, `Equatable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Strideable`, `Hashable`, `Comparable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Strideable`, `Equatable`, `Comparable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Strideable`, `Hashable`, `Comparable`, `Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Strideable`, `Equatable`, `Comparable`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Equatable`
func !=(_: Self, rhs: Self)

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`FixedWidthInteger`
func !=(_: Self, rhs: Self)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b` implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`) for any type that conforms to `Equatable`.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

`func !=(lhs: Self, rhs: Self) -> Bool`

Declared In

`Hashable`, `Comparable`, `Equatable`
func !=(_: UInt, rhs: UInt)

Declaration

`func !=(lhs: UInt, rhs: UInt) -> Bool`

Declared In

`UInt`, `FixedWidthInteger`
func !=(_: UInt8, rhs: UInt8)

Declaration

`func !=(lhs: UInt8, rhs: UInt8) -> Bool`

Declared In

`UInt8`, `FixedWidthInteger`
func !=(_: UInt16, rhs: UInt16)

Declaration

`func !=(lhs: UInt16, rhs: UInt16) -> Bool`

Declared In

`UInt16`, `FixedWidthInteger`
func !=(_: UInt32, rhs: UInt32)

Declaration

`func !=(lhs: UInt32, rhs: UInt32) -> Bool`

Declared In

`UInt32`, `FixedWidthInteger`
func !=(_: UInt64, rhs: UInt64)

Declaration

`func !=(lhs: UInt64, rhs: UInt64) -> Bool`

Declared In

`UInt64`, `FixedWidthInteger`
func !=(_: Wrapped?, rhs: _OptionalNilComparisonType)

Returns a Boolean value indicating whether the left-hand-side argument is not `nil`.

You can use this not-equal-to operator (`!=`) to test whether an optional instance is not `nil` even when the wrapped value's type does not conform to the `Equatable` protocol.

The following example declares the `stream` variable as an optional instance of a hypothetical `DataStream` type. Although `DataStream` is not an `Equatable` type, this operator allows checking whether `stream` wraps a value and is therefore not `nil`.

``````var stream: DataStream? = fetchDataStream()
if stream != nil {
print("The data stream has been configured.")
}
// Prints "The data stream has been configured."``````

Parameters: lhs: A value to compare to `nil`. rhs: A `nil` literal.

Declaration

`func !=(lhs: Wrapped?, rhs: _OptionalNilComparisonType) -> Bool`
func !=(_: Wrapped?, rhs: Wrapped?)

Returns a Boolean value indicating whether two optional instances are not equal.

Use this not-equal-to operator (`!=`) to compare any two optional instances of a type that conforms to the `Equatable` protocol. The comparison returns `true` if only one of the arguments is `nil` or if the two arguments wrap values that are not equal. The comparison returns `false` if both arguments are `nil` or if the two arguments wrap values that are equal.

``````let group1 = [2, 4, 6, 8, 10]
let group2 = [1, 3, 5, 7, 9]
if group1.first != group2.first {
print("The two groups start differently.")
}
// Prints "The two groups start differently."``````

You can also use this operator to compare a non-optional value to an optional that wraps the same type. The non-optional value is wrapped as an optional before the comparison is made. In this example, the `numberToMatch` constant is wrapped as an optional before comparing to the optional `numberFromString`:

``````let numberToFind: Int = 23
let numberFromString: Int? = Int("not-a-number")      // nil
if numberToFind != numberFromString {
print("No match.")
}
// Prints "No match."``````

Parameters: lhs: An optional value to compare. rhs: Another optional value to compare.

Declaration

`func !=(lhs: Wrapped?, rhs: Wrapped?) -> Bool`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <Other>(_: Self, rhs: Other)

Returns a Boolean value indicating whether the two given values are not equal.

You can check the inequality of instances of any `BinaryInteger` types using the not-equal-to operator (`!=`). For example, you can test whether the first `UInt8` value in a string's UTF-8 encoding is not equal to the first `UInt32` value in its Unicode scalar view:

``````let gameName = "Red Light, Green Light"
if let firstUTF8 = gameName.utf8.first,
let firstScalar = gameName.unicodeScalars.first?.value {
print("First code values are different: \(firstUTF8 != firstScalar)")
}
// Prints "First code values are different: false"``````

Parameters: lhs: An integer to compare. rhs: Another integer to compare.

Declaration

`func !=<Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger`

Declared In

`FixedWidthInteger`
func != <S>(_: Self, rhs: S)

Declaration

`func !=<S>(lhs: Self, rhs: S) -> Bool where S : StringProtocol`

Declared In

`StringProtocol`, `Comparable`, `Hashable`, `Equatable`