<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/PersonNameComponentsFormatter/localizedString(from:style:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersonNameComponentsFormatter(cm)localizedStringFromPersonNameComponents:style:options:"
  },
  "title" : "localizedString(from:style:options:)"
}
-->

# localizedString(from:style:options:)

Returns a string formatted for a given `NSPersonNameComponents` object using the provided style and options.

```
class func localizedString(from components: PersonNameComponents, style nameFormatStyle: PersonNameComponentsFormatter.Style, options nameOptions: PersonNameComponentsFormatter.Options = []) -> String
```

## Parameters

`components`

The name components to be formatted.

`nameFormatStyle`

A format style for the name components. For possible values, see [`PersonNameComponentsFormatter.Style`](/documentation/Foundation/PersonNameComponentsFormatter/Style-swift.enum).

`nameOptions`

The formatting options for the name components. For possible values, see [`PersonNameComponentsFormatter.Options`](/documentation/Foundation/PersonNameComponentsFormatter/Options).

## Return Value

A formatted string representation of the given name components.

## Discussion

This method is a convenience for formatting name components without creating an instance of `NSPersonNameComponentsFormatter`. For greater customizability, you can create an instance of `NSPersonNameComponentsFormatter` and use [`string(from:)`](/documentation/Foundation/PersonNameComponentsFormatter/string(from:)) instead.

---

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)