---
title: compareAnchored
framework: corefoundation
role: symbol
role_heading: Type Property
path: corefoundation/cfstringcompareflags/compareanchored
---

# compareAnchored

Performs searching only on characters at the beginning or end of the range.

## Declaration

```swift
static var compareAnchored: CFStringCompareFlags { get }
```

## Discussion

Discussion No match at the beginning or end means nothing is found, even if a matching sequence of characters occurs elsewhere in the string.

## See Also

### Constants

- [compareCaseInsensitive](corefoundation/cfstringcompareflags/comparecaseinsensitive.md)
- [compareBackwards](corefoundation/cfstringcompareflags/comparebackwards.md)
- [compareNonliteral](corefoundation/cfstringcompareflags/comparenonliteral.md)
- [compareLocalized](corefoundation/cfstringcompareflags/comparelocalized.md)
- [compareNumerically](corefoundation/cfstringcompareflags/comparenumerically.md)
- [compareDiacriticInsensitive](corefoundation/cfstringcompareflags/comparediacriticinsensitive.md)
- [compareWidthInsensitive](corefoundation/cfstringcompareflags/comparewidthinsensitive.md)
- [compareForcedOrdering](corefoundation/cfstringcompareflags/compareforcedordering.md)
