How to edit text on runtime?

I want the player to be able to write his name, which would then be held as a variable or a string, something I could save and then use later for if() and what not. How exactly can I present the player with a tiny square in which he could write his name, which then would be saved as a string somewhere in the code. Or just in general, how to write on runtime? :))

See GUI.TextField() reference page…includes sample code.