---
title: "init(cString:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/stringprotocol/init(cstring:)"
---

# init(cString:)

Creates a string from the null-terminated, UTF-8 encoded sequence of bytes at the given pointer.

## Declaration

```swift
init(cString nullTerminatedUTF8: UnsafePointer<CChar>)
```

## Parameters

- `nullTerminatedUTF8`: A pointer to a sequence of contiguous, UTF-8 encoded bytes ending just before the first zero byte.
