Getting rid of whitespace

Hello I’m trying to convert a String into an Array of words. To do so I split the String when a space is met, and make a new Array containing only the words.

The problem is when I try to get rid of any whitespace. The code works as intended for the whitespace between the words but ALWAYS fails to remove ONE whitespace if there are spaces at the start of my String.

function _processF(e:MouseEvent):void {
    var toProcess="   Hello world"
    sentence=[];
    if (toProcess.indexOf(" ",0)>=0) {
        sentence=toProcess.split(/ /);
    } else {
        sentence=[toProcess];
    }
    for (var m:Number=0; m<=sentence.length-1; m++) {
        if (sentence[m]=="") {
            sentence.splice(m,1);
            m--;

        }

    }


    trace(sentence); // ,Hello,world
}

As seen it accounts the last whitespace in front of my sentence as a word and doesn’t remove from the Array.