# DeleteRange(MarkupAttribute)

Method in [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md)

## Summary

Deletes an attribute from this markup.

```csharp
public MarkupParseResult DeleteRange(MarkupAttribute attributeToDelete)
```

## Remarks

This method deletes the range of text covered by `attributeToDelete` , and updates the other attributes in this markup as follows:

* Attributes that start and end before the deleted attribute are unmodified.
* Attributes that start before the deleted attribute and end inside it are truncated to remove the part overlapping the deleted attribute.
* Attributes that have the same position and length as the deleted attribute are deleted, if they apply to any text.
* Attributes that start and end within the deleted attribute are deleted.
* Attributes that start within the deleted attribute, and end outside it, have their start truncated to remove the part overlapping the deleted attribute.
* Attributes that start after the deleted attribute have their start point adjusted to account for the deleted text.

This method does not modify the current object. A new [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md) is returned.

If `attributeToDelete` is not an attribute of this [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md), the behaviour is undefined.

## Parameters

| Name                                                                                                        | Description              |
| ----------------------------------------------------------------------------------------------------------- | ------------------------ |
| [Yarn.Markup.MarkupAttribute](/2.0/api/csharp/yarn.markup/yarn.markup.markupattribute.md) attributeToDelete | The attribute to remove. |

## Returns

A new [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md) object, with the plain text modified and an updated collection of attributes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult/yarn.markup.markupparseresult.deleterange.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
