---
title: "CFAttributedStringReplaceString(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfattributedstringreplacestring(_:_:_:)"
---

# CFAttributedStringReplaceString(_:_:_:)

Modifies the string of an attributed string.

## Declaration

```swift
func CFAttributedStringReplaceString(_ aStr: CFMutableAttributedString!, _ range: CFRange, _ replacement: CFString!)
```

## Parameters

- `aStr`: The mutable attributed string to modify.
- `range`: The range of aStr to be modified. range must not specify characters outside the bounds of aStr.
- `replacement`: The string to replace the existing string in range.

## See Also

### Modifying a CFMutableAttributedString

- [CFAttributedStringBeginEditing(_:)](corefoundation/cfattributedstringbeginediting(_:).md)
- [CFAttributedStringEndEditing(_:)](corefoundation/cfattributedstringendediting(_:).md)
- [CFAttributedStringGetMutableString(_:)](corefoundation/cfattributedstringgetmutablestring(_:).md)
- [CFAttributedStringRemoveAttribute(_:_:_:)](corefoundation/cfattributedstringremoveattribute(_:_:_:).md)
- [CFAttributedStringReplaceAttributedString(_:_:_:)](corefoundation/cfattributedstringreplaceattributedstring(_:_:_:).md)
- [CFAttributedStringSetAttribute(_:_:_:_:)](corefoundation/cfattributedstringsetattribute(_:_:_:_:).md)
- [CFAttributedStringSetAttributes(_:_:_:_:)](corefoundation/cfattributedstringsetattributes(_:_:_:_:).md)
