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

# xpc_string_create_with_format_and_arguments(_:_:)

Creates an XPC object that represents a C-string that the specified format string and argument list pointer generate.

## Declaration

```swift
func xpc_string_create_with_format_and_arguments(_ fmt: UnsafePointer<CChar>, _ ap: CVaListPointer) -> xpc_object_t
```

## Parameters

- `fmt`: The printf(3)-style format string from which to construct the final C-string to be boxed.
- `ap`: A pointer to the arguments which correspond to those specified in the format string.

## Return Value

Return Value A new string object.

## See Also

### String objects

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