I have a function to always remove the 2nd word from a sentence.
public cleanMessage(message) {
let cleanedMessage: any = message.split(' ');
cleanedMessage.splice(1, 1);
cleanedMessage = cleanedMessage.join(' ');
return cleanedMessage;
}
cleanMessage('Hello there world')
// outputs 'Hello world'
Is there a cleaner way of doing this?