---
title: isEqualTo
framework: Kernel
role: symbol
role_heading: Instance Method
platforms: [driverkit 19.0+, macOS 10.15.2+]
path: kernel/osstring/3433852-isequalto
---

# isEqualTo

Compares the string with an OSData.

## Declaration

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

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

## 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](kernel/osstring/3180976-isequalto.md)
- [isEqualTo](kernel/osstring/3433853-isequalto.md)
- [isEqualTo](kernel/osstring/3434577-isequalto.md)
