---
title: isEqualTo
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osstring/isequalto-1uq1f
---

# isEqualTo

Compares the string with an OSData.

## Declaration

```occ
bool isEqualTo(const OSData *aDataObject) const;
```

## Parameters

- `aDataObject`: The OSData to compare with.

## Return Value

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

## Discussion

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

## See Also

### Comparing Strings

- [isEqualTo](driverkit/osstring/isequalto-712xj.md)
- [isEqualTo](driverkit/osstring/isequalto-5paj5.md)
- [isEqualTo](driverkit/osstring/isequalto-2rg80.md)
