---
title: OSString
framework: driverkit
role: symbol
role_heading: Class
path: driverkit/osstring
---

# OSString

A container for managing an array of characters.

## Declaration

```occ
class OSString;
```

## Overview

Overview OSString is a container class for managing arrays of characters. Encodings OSString makes no provisions for different character encodings and assumes that a string is a nul-terminated sequence of single-byte characters. User-space code must either assume an encoding (typically ASCII or UTF-8) or determine it in some other way (such as an IORegistryEntry property). OSString is immutable.

## Topics

### Creating a String

- [withString](driverkit/osstring/withstring.md)
- [withCString](driverkit/osstring/withcstring-4wsql.md)
- [withCString](driverkit/osstring/withcstring-721oh.md)
- [withCStringNoCopy](driverkit/osstring/withcstringnocopy.md)
- [OSStringCreate](driverkit/osstringcreate.md)
- [free](driverkit/osstring/free.md)

### Getting a C String

- [getCStringNoCopy](driverkit/osstring/getcstringnocopy.md)
- [OSStringGetStringPtr](driverkit/osstringgetstringptr.md)
- [OSStringPtr](driverkit/osstringptr.md)

### Inspecting a String

- [getLength](driverkit/osstring/getlength.md)
- [OSStringGetLength](driverkit/osstringgetlength.md)

### Comparing Strings

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

## Relationships

### Inherits From

- [OSContainer](driverkit/oscontainer.md)

## See Also

### Registry data types

- [OSArray](driverkit/osarray.md)
- [OSDictionary](driverkit/osdictionary.md)
- [OSBoolean](driverkit/osboolean.md)
- [OSData](driverkit/osdata.md)
- [OSNumber](driverkit/osnumber.md)
- [OSSerialization](driverkit/osserialization.md)
- [OSCollection](driverkit/oscollection.md)
- [OSContainer](driverkit/oscontainer.md)
- [OSObject](driverkit/osobject.md)
- [OSSymbol](driverkit/ossymbol.md)
- [IOFixed](driverkit/iofixed.md)
