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

# isEqualTo

Compares the data with an OSString

## Declaration

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

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

## 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](kernel/osdata/3180882-isequalto.md)
- [isEqualTo](kernel/osdata/3433844-isequalto.md)
- [isEqualTo](kernel/osdata/3433858-isequalto.md)
