# FindStyle(string)

> Try to search for a GUIStyle. This functions returns NULL and does not give an error.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

```csharp
public GUIStyle FindStyle(string styleName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Returns

| Type                                                                | Description |
| ------------------------------------------------------------------- | ----------- |
| [GUIStyle](/engine/6000.0/script-reference/unityengine/guistyle.md) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // Checks if a style name exists

    string aStyleName = "A Style I have";

    void OnGUI()
    {
        if (GUI.skin.FindStyle(aStyleName) == null)
        {
            Debug.LogWarning("No style named \"" + aStyleName + "\" could be found");
        }
    }
}
```
