# TryGetCulture(string,Culture)

Method in [Cultures](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.cultures)

## Summary

Gets the [Culture](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.culture) represented by the language code in `name` .

```csharp
public static bool TryGetCulture(string name, out Culture culture)
```

## Parameters

| Name                                                                                                | Description                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` name                                                                                       | The name of the [Culture](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.culture) to retrieve.                                                                                                                 |
| [Yarn.Unity.Culture](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.culture) culture | On return, the [Culture](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.culture) if one was found, or a default [Culture](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.culture) if otherwise. |

## Returns

`true` if a Culture was found; `false` otherwise.


---

# 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/api/csharp/yarn.unity/yarn.unity.cultures/yarn.unity.cultures.trygetculture.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.
