---
title: isEqualTo
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osdata/isequalto-5ssf5
---

# isEqualTo

Compares the data with an OSString

## Declaration

```occ
bool isEqualTo(const OSString *aString) const;
```

## Parameters

- `aString`: The object to compare with.

## Return Value

Return Value True if the OSData and OSString contain the same c-string.

## Discussion

Discussion If the passed OSString object has the same length and all bytes are identical, true is returned. If the passed OSString object has a length one byte less than the OSData, all bytes are identical, and the last byte of the OSData is zero, true is returned. Otherwise false is returned.

## See Also

### Comparing Data Objects

- [isEqualTo](driverkit/osdata/isequalto-2kdml.md)
- [isEqualTo](driverkit/osdata/isequalto-4xz0j.md)
- [isEqualTo](driverkit/osdata/isequalto-79gqy.md)
