# TryGetAttributeWithName(string,MarkupAttribute)

Method in [MarkupParseResult](https://docs.yarnspinner.dev/2.4/api/csharp/yarn.markup/yarn.markup.markupparseresult)

## 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](https://docs.yarnspinner.dev/2.4/api/csharp/yarn.markup/yarn.markup.markupattribute) attribute | When this method returns, contains the attribute with the specified name, if the attribute is found; otherwise, the default [MarkupAttribute](https://docs.yarnspinner.dev/2.4/api/csharp/yarn.markup/yarn.markup.markupattribute) . This parameter is passed uninitialized. |

## Returns

`true` if the [MarkupParseResult](https://docs.yarnspinner.dev/2.4/api/csharp/yarn.markup/yarn.markup.markupparseresult) contains an attribute with the specified name; otherwise, `false` .
