+ 1
Replace specific string with another string
if text is contain '*' then replce that element '*' with this one 'Ă' how to do that https://code.sololearn.com/W3QQfKvaA3XX/?ref=app
3 Respostas
+ 5
Use replaceAll function
console.log(text.replaceAll("*", "+"))
+ 3
It's work thanks man AÍąJ - SÍoÍlÍoÍHÍeÍlÍpÍeÍrÍ
+ 3
Use replace func
var str = "Sololearn is great";
var result = str.replace("great", "nice");
To replace all add /"str"/g
var str = "Sololearn is great";
var result = str.replace("/great/g", "nice");