<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_string_create_with_format_and_arguments(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@F@xpc_string_create_with_format_and_arguments"
  },
  "title" : "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.

```
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

A new string object.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)