> For the complete documentation index, see [llms.txt](https://docs.tankandhealerstudio.com/assets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tankandhealerstudio.com/assets/ultimatechatbox/documentation/ultimatechatbox/public-methods/clearchat.md).

# ClearChat

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```csharp
using UnityEngine;
using TankAndHealerStudioAssets;

public class ChatBoxExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateChatBox chatBox;

	void Update ()
	{
		// If the space key has been pressed...
    		if( Input.GetKeyDown( KeyCode.Space ) )
        	{
        		// Clear the chat box of all entries.
			chatBox.ClearChat();
        	}
	}
}
```

{% endcode %}
