+ 2

help with JavaScript

how to replace a letter at the end of a word using regular expressions?

13th Sep 2022, 8:09 PM
ŠŠ½Š°Ń‚Š¾Š»ŠøŠ¹ ŠØŠ¼ŠµŠ»ŃŒ
3 Answers
+ 2
You Can use replace(/.$/, the new letter)
14th Sep 2022, 6:23 AM
Roland
Roland - avatar
+ 2
const replaceAll = (str, replace) => str.replaceAll(/[^\s.]\b/g, replace); let rA = replaceAll('How Are You', '*'); console.log('replaceAll:', rA); https://www.sololearn.com/compiler-playground/Wq9ZB566lZtm
15th Sep 2022, 10:53 PM
SoloProg
SoloProg - avatar
0
if you know , please say me
13th Sep 2022, 8:12 PM
ŠŠ½Š°Ń‚Š¾Š»ŠøŠ¹ ŠØŠ¼ŠµŠ»ŃŒ