---
title: "init(platformString:)"
framework: system
role: symbol
role_heading: Initializer
path: "system/filepath/component/init(platformstring:)-2tz4"
---

# init(platformString:)

Creates a file path component by copying bytes from a null-terminated platform string. It is a precondition that a null byte indicates the end of the string. The absence of a null byte will trigger a runtime error.

## Declaration

```swift
init?(platformString: [CInterop.PlatformChar])
```

## Parameters

- `platformString`: A null-terminated platform string.

## Discussion

Discussion Returns nil if platformString is empty, is a root, or has more than one component in it. Note It is a precondition that platformString must be null-terminated. The absence of a null byte will trigger a runtime error.
