I have a problem with the "replace" method. It doesn't work correctly. I'm working with the game engine Cocos Creator v.3.8.1. I need to place spaces in a string between letters, and 3 spaces between words.
I use the following code for this:
let testStr : string = "test string";
testStr = testStr.toUpperCase().replace(' ','#').split('').join(' ').replace('#',' ');
console.log(testStr);
But for some reason there is only 1 symbol between words.
Output: T E S T S T R I N G