<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteboard/string",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPasteboard(py)string"
  },
  "title" : "string"
}
-->

# string

The string value of the first pasteboard item.

```
var string: String? { get set }
```

## Discussion

The value stored in this property is an <doc://com.apple.documentation/documentation/Foundation/NSString> object. The associated array of representation types is [`typeListString`](/documentation/UIKit/UIPasteboard/typeListString), which includes type `kUTTypeUTF8PlainText`. Setting this property replaces all current items in the pasteboard with the new item. If the first item has no value of the indicated type, `nil` is returned.

> Note:
> Do not use this property to determine if a pasteboard contains string data. Instead, use the ``doc://com.apple.uikit/documentation/UIKit/UIPasteboard/hasStrings`` property.

---

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)