> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute.md).

# MarkupAttribute

Struct in [Yarn.Markup](/3.1/api/csharp/yarn.markup.md)

Inherits from `System.ValueType`

## Summary

Represents a range of text in a marked-up string.

```csharp
public struct MarkupAttribute
```

## Remarks

You do not create instances of this struct yourself. It is created by objects that can parse markup, such as [LineParser](/3.1/api/csharp/yarn.markup/yarn.markup.lineparser.md) .

## Methods

| Name                                                                                                                                          | Description                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Shift(int)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.shift.md)                                    | Creates a new [MarkupAttribute](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute.md) based on the current instance whose [Position](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.position.md) is shifted towards the end of the string by `shift` characters. |
| [ToString()](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.tostring.md)                                 |                                                                                                                                                                                                                                                                                                             |
| [TryGetProperty(string,bool)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.trygetproperty-5.md)        | Gets a boolean property named `name` from this attribute, if present.                                                                                                                                                                                                                                       |
| [TryGetProperty(string,int)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.trygetproperty-3.md)         | Gets an integer property named `name` from this attribute, if present.                                                                                                                                                                                                                                      |
| [TryGetProperty(string,float)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.trygetproperty-2.md)       | Gets a float property named `name` from this attribute, if present.                                                                                                                                                                                                                                         |
| [TryGetProperty(string,string?)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.trygetproperty-4.md)     | Gets a string property named `name` from this attribute, if present.                                                                                                                                                                                                                                        |
| [TryGetProperty(string,MarkupValue)](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.trygetproperty-1.md) | Gets a property named `name` from this attribute, if present.                                                                                                                                                                                                                                               |

## Properties

| Name                                                                                                            | Description                                                                    |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [Length](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.length.md)         | Gets the number of text elements in the plain text that this attribute covers. |
| [Name](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.name.md)             | Gets the name of the attribute.                                                |
| [Position](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.position.md)     | Gets the position in the plain text where this attribute begins.               |
| [Properties](/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute/yarn.markup.markupattribute.properties.md) | Gets the properties associated with this attribute.                            |

## See Also

* Yarn.Markup.LineParser.ParseString(System.String,System.String,System.Boolean,System.Boolean,System.Boolean):


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/3.1/api/csharp/yarn.markup/yarn.markup.markupattribute.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.
