Simple TextBox check question.

Hello, I have a small problem that I can’t find answer too.

I have a textbox were the player enters their name. I want to be able to make some sort of check so that there must always be something written in it before proceeding.

I was reading the Text Box guide and it had " static function TextField (position : Rect, text : String, maxLength : int) : String " I am assuming something along does lines.

Check the Length of the text string before continuing :

#pragma strict

var textString : String = "";

function OnGUI() 
{
	textString = GUI.TextField( Rect( 20, 20, 200, 35 ), textString );
	
	if ( GUI.Button( Rect( 20, 60, 200, 35 ), "Enter" ) )
	{
		if ( textString.Length > 0 ) // check the length of the textfield string is greater than zero
		{
			Debug.Log( "Hello " + textString );
		}
		else
		{
			Debug.Log( "Enter Your Name" );
		}
	}
}