Operatorswift 6.0.1Swift
!=(_:_:)
Returns a Boolean value indicating whether the two given values are not equal.
static func != <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Parameters
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"
Other members in extension
Type members
init(
) Creates a new value equal to zero.
static func != (lhs: Self, rhs: Self
) -> Bool static func & (lhs: Self, rhs: Self
) -> Self Returns the result of performing a bitwise AND operation on the two given values.
static func < <Other>(lhs: Self, rhs: Other
) -> Bool Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.
static func << <RHS>(lhs: Self, rhs: RHS
) -> Self Returns the result of shifting a value’s binary representation the specified number of digits to the left.
static func <= <Other>(lhs: Self, rhs: Other
) -> Bool Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func <= (lhs: Self, rhs: Self
) -> Bool static func == <Other>(lhs: Self, rhs: Other
) -> Bool Returns a Boolean value indicating whether the two given values are equal.
static func > <Other>(lhs: Self, rhs: Other
) -> Bool Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func > (lhs: Self, rhs: Self
) -> Bool static func >= <Other>(lhs: Self, rhs: Other
) -> Bool Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
static func >= (lhs: Self, rhs: Self
) -> Bool static func >> <RHS>(lhs: Self, rhs: RHS
) -> Self Returns the result of shifting a value’s binary representation the specified number of digits to the right.
static func ^ (lhs: Self, rhs: Self
) -> Self Returns the result of performing a bitwise XOR operation on the two given values.
static func | (lhs: Self, rhs: Self
) -> Self Returns the result of performing a bitwise OR operation on the two given values.
Instance members
var description: String
A textual representation of this value.
func advanced(by: Int
) -> Self Returns a value that is offset the specified distance from this value.
func distance(to: Self
) -> Int Returns the distance from this value to the given value, expressed as a stride.
func isMultiple(of: Self
) -> Bool func quotientAndRemainder(dividingBy: Self
) -> (quotient: Self, remainder: Self) Returns the quotient and remainder of this value divided by the given value.
func signum(
) -> Self Returns
-1
if this value is negative and1
if it’s positive; otherwise,0
.