js get first space in string code example Example: js get first space in string str.match(/^(\S+)\s(.*)/).slice(1)