---
title: forcedOrdering
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsstring/compareoptions/forcedordering
---

# forcedOrdering

Comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal.

## Declaration

```swift
static var forcedOrdering: NSString.CompareOptions { get }
```

## Discussion

Discussion This option ensures reliable, reproducible results when sorting. For example, “aaa” is greater than “AAA”  if caseInsensitive is specified.

## See Also

### Constants

- [caseInsensitive](foundation/nsstring/compareoptions/caseinsensitive.md)
- [literal](foundation/nsstring/compareoptions/literal.md)
- [backwards](foundation/nsstring/compareoptions/backwards.md)
- [anchored](foundation/nsstring/compareoptions/anchored.md)
- [numeric](foundation/nsstring/compareoptions/numeric.md)
- [diacriticInsensitive](foundation/nsstring/compareoptions/diacriticinsensitive.md)
- [widthInsensitive](foundation/nsstring/compareoptions/widthinsensitive.md)
- [regularExpression](foundation/nsstring/compareoptions/regularexpression.md)
