0

Does anyone know this issue about replace function of javascript ? I only want to replace string.

"$$$AAA".replace("$$$AAA","$$$aaa");

Event using with regex it's getting same output.

"$$$AAA".replace(new RegExp(/\$\$\$AAA/, "gi"),"$$$aaa");

Output

$$aa

Expected

$$$aaa

It's strip out the first $

0 Answers0