---
title: "xpc_string_create(_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_string_create(_:)"
---

# xpc_string_create(_:)

Creates an XPC object that represents a null-terminated C-string.

## Declaration

```swift
func xpc_string_create(_ string: UnsafePointer<CChar>) -> xpc_object_t
```

## Parameters

- `string`: The C-string which is to be boxed.

## Return Value

Return Value A new string object.

## See Also

### String objects

- [xpc_string_create_with_format_and_arguments(_:_:)](xpc/xpc_string_create_with_format_and_arguments(_:_:).md)
- [xpc_string_get_length(_:)](xpc/xpc_string_get_length(_:).md)
- [xpc_string_get_string_ptr(_:)](xpc/xpc_string_get_string_ptr(_:).md)
