Type MethodFoundationEssentials
identifier(_:from:)
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
Returns the identifier conforming to the specified standard for the specified string.
static func identifier(_ type: Locale.IdentifierType, from string: String) -> String
Parameters
typeThe identifier type used by
string, such asLocale.IdentifierType.icuorLocale.IdentifierType.bcp47.stringAn identifier string that complies with the standard indicated by
type.
Return Value
A locale identifier.