---
title: "identifier(_:from:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/locale/identifier(_:from:)"
---

# identifier(_:from:)

Returns the identifier conforming to the specified standard for the specified string.

## Declaration

```swift
static func identifier(_ type: Locale.IdentifierType, from string: String) -> String
```

## Parameters

- `type`: The identifier type used by string, such as doc://com.apple.foundation/documentation/Foundation/Locale/IdentifierType/icu or doc://com.apple.foundation/documentation/Foundation/Locale/IdentifierType/bcp47.
- `string`: An identifier string that complies with the standard indicated by type.

## Return Value

Return Value A locale identifier.

## See Also

### Converting between identifiers

- [canonicalIdentifier(from:)](foundation/locale/canonicalidentifier(from:).md)
- [components(fromIdentifier:)](foundation/locale/components(fromidentifier:).md)
- [identifier(fromComponents:)](foundation/locale/identifier(fromcomponents:).md)
- [Locale.IdentifierType](foundation/locale/identifiertype.md)
- [canonicalLanguageIdentifier(from:)](foundation/locale/canonicallanguageidentifier(from:).md)
- [identifier(fromWindowsLocaleCode:)](foundation/locale/identifier(fromwindowslocalecode:).md)
- [windowsLocaleCode(fromIdentifier:)](foundation/locale/windowslocalecode(fromidentifier:).md)
