This commit is contained in:
Timothy J. Baek
2024-08-23 14:43:32 +02:00
parent 591962d906
commit 7b91be21b4
3 changed files with 9 additions and 6 deletions

View File

@@ -297,7 +297,10 @@ export const removeLastWordFromString = (inputString, wordString) => {
}
// Join the remaining words back into a string
const resultString = words.join(' ');
let resultString = words.join(' ');
if (resultString !== '') {
resultString += ' ';
}
return resultString;
};