> 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/2.5/api/csharp/yarn.markup/yarn.markup.markupparseresult/yarn.markup.markupparseresult.trygetattributewithname.md).

# TryGetAttributeWithName(string,MarkupAttribute)

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

## Summary

Gets the first attribute with the specified name, if present.

```csharp
public bool TryGetAttributeWithName(string name, out MarkupAttribute attribute)
```

## Parameters

| Name                                                                                                | Description                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` name                                                                                       | The name of the attribute to get.                                                                                                                                                                                                                   |
| [Yarn.Markup.MarkupAttribute](/2.5/api/csharp/yarn.markup/yarn.markup.markupattribute.md) attribute | When this method returns, contains the attribute with the specified name, if the attribute is found; otherwise, the default [MarkupAttribute](/2.5/api/csharp/yarn.markup/yarn.markup.markupattribute.md) . This parameter is passed uninitialized. |

## Returns

`true` if the [MarkupParseResult](/2.5/api/csharp/yarn.markup/yarn.markup.markupparseresult.md) contains an attribute with the specified name; otherwise, `false` .
