<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Formatter/editingString(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFormatter(im)editingStringForObjectValue:"
  },
  "title" : "editingString(for:)"
}
-->

# editingString(for:)

The default implementation of this method invokes [`string(for:)`](/documentation/Foundation/Formatter/string(for:)).

```
func editingString(for obj: Any) -> String?
```

## Parameters

`obj`

The object for which to return an editing string.

## Return Value

An `NSString` object that is used for editing the textual representation of `anObject`.

## Discussion

When implementing a subclass, override this method only when the string that users see and the string that they edit are different. In your implementation, return an `NSString` object that is used for editing, following the logic recommended for implementing [`string(for:)`](/documentation/Foundation/Formatter/string(for:)). As an example, you would implement this method if you want the dollar signs in displayed strings removed for editing.

---

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)