function TrimString(str)
{
	var arrMatches = str.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (arrMatches == null) ? "" : arrMatches[1];
}