---
title: "editingString(for:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/formatter/editingstring(for:)"
---

# editingString(for:)

The default implementation of this method invokes string(for:).

## Declaration

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

## Parameters

- `obj`: The object for which to return an editing string.

## Return Value

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

## Discussion

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:). As an example, you would implement this method if you want the dollar signs in displayed strings removed for editing.

## See Also

### Getting Textual Representations of Object Values

- [string(for:)](foundation/formatter/string(for:).md)
- [attributedString(for:withDefaultAttributes:)](foundation/formatter/attributedstring(for:withdefaultattributes:).md)
