<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/PersonNameComponents/FormatStyle/format(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation20PersonNameComponentsV11FormatStyleV6formatySSACF"
  },
  "title" : "format(_:)"
}
-->

# format(_:)

Creates a string representation from a person name components value.

```
func format(_ value: PersonNameComponents) -> String
```

## Parameters

`value`

The person name components object to format.

## Return Value

A string representation of the person name components.

## Discussion

The [`format(_:)`](/documentation/Foundation/PersonNameComponents/FormatStyle/format(_:)) instance method applies the style to an instance of `PersonNameComponent`. After creating a style, you can use it to format multiple instances of person name components. For example:

```swift
let customPersonFormatStyle = PersonNameComponents.FormatStyle(style: .medium, locale: Locale(identifier: "us_EN"))

var person1 = PersonNameComponents()
person1.familyName = "Clark"
person1.givenName = "Thomas"
person1.middleName = "Louis"
person1.namePrefix = "Dr."
person1.nickname = "Tom"
person1.nameSuffix = "Esq."

let customPersonString1 = 
customPersonFormatStyle.format(person1)
// Thomas Clark

let customPersonString2 = 
customPersonFormatStyle.format(person2)
// Maria Ruiz
```

---

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)