---
title: "init(_:including:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/attributedstring/init(_:including:)-9ejyj"
---

# init(_:including:)

Creates an attributed string from another attributed string, including an attribute scope that a key path identifies.

## Declaration

```swift
init<S, T>(_ other: T, including scope: KeyPath<AttributeScopes, S.Type>) where S : AttributeScope, T : AttributedStringProtocol
```

## Parameters

- `other`: An attributed string or attributed substring.
- `scope`: An doc://com.apple.foundation/documentation/Foundation/AttributeScopes key path that identifies an attribute scope to associate with the attributed string.

## See Also

### Creating a Duplicate Attributed String

- [init(_:including:)](foundation/attributedstring/init(_:including:)-6u3ho.md)
