<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Assignables",
  "identifier" : "/documentation/Assignables/UserIdentityFactory/string(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Assignables"
    ],
    "preciseIdentifier" : "s:11Assignables19UserIdentityFactoryO6stringyAA06StringbC0VSSFZ"
  },
  "title" : "string(_:)"
}
-->

# string(_:)

Creates a [`StringUserIdentity`](/documentation/Assignables/StringUserIdentity) with the given string value.

```
static func string(_ value: String) -> StringUserIdentity
```

## Parameters

`value`

The value of the string to contain in this user identity.

## Return Value

A `StringUserIdentity` object with the given string value.

---

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)