<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/OSString/isEqualTo-2rg80",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@OSString@F@isEqualTo#*1C#1"
  },
  "title" : "isEqualTo"
}
-->

# isEqualTo

Compares the string with a c-string.

```
bool isEqualTo(const char *cString) const;
```

## Parameters

`cString`

The c-string to compare with.

## Return Value

true iff the two strings have the same length and characters.

## Discussion

If the passed c-string has the same length and all characters are identical to those in the OSString, true is returned. Otherwise false is returned.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)