---
title: "CFAttributedStringReplaceAttributedString(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfattributedstringreplaceattributedstring(_:_:_:)"
---

# CFAttributedStringReplaceAttributedString(_:_:_:)

Replaces the attributed substring over a range with another attributed string.

## Declaration

```swift
func CFAttributedStringReplaceAttributedString(_ aStr: CFMutableAttributedString!, _ range: CFRange, _ replacement: CFAttributedString!)
```

## 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 attributed string to replace the contents of aStr in range.

## See Also

### Modifying a CFMutableAttributedString

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