I'm trying to split a string from the second position in my string which I pass to the function.
Current position:
commandHandler(player: PlayerMp, command: string) {
if(command.startsWith("/", 0)){
const cmd = command.match(/\S+/g);
cmd.forEach(element => console.log(element));
}
}
If I pass "/test this" to this function then I get the following response: 1) "/test" 2) "this" while I need the following response: 1) "test" 2) "this"
What am I doing wrong?