Creating a server console / javascript string manipulation

I’m just wondering if someone has an efficient way to go about checking/detecting the different words in a string (via javascript).

So for example, if I type in…

The function would return the strings “disconnect_player” and “1”. I’ve had to use multiple languages recently and find myself returning to javascript for this particular phase of my project. Any help would be greatly appreciated, even if it’s just the method for checking characters.

I’m always partial to “split”, though I haven’t tested it in Unity.

function doWhatever() {
    var s_phrase : string = "disconnect_player 1";
    var a_words : Array;
    a_words = new Array();
    a_words = s_phrase.split(" ");
}

The array a_words will (should) contain each of the words in the original phrase.

Thanks, you pointed me in the right direction, now using:

function execute_server_console_command(console_command:String)
	{	
var refined_command = console_command.Split(" "[0]); 
print(refined_command[1]);
	}