JavaScript (Node.js), 38 bytes
s=>s.replace(/(.)(.)(\s|$)/g,"2ドル1ドル3ドル")
RegExp approach, assuming words separated by only 1 space.
Shieru Asakoto
- 6.5k
- 19
- 43
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchanges=>s.replace(/(.)(.)(\s|$)/g,"2ドル1ドル3ドル")
RegExp approach, assuming words separated by only 1 space.