Question: How do I replace something with template literals? I'm trying to pass in a character that I want replaced - in this case I'm trying to replace a specific character with an empty string.

```
function replace(romanNumeral, replace) {
  var newStr = romanNumeral.replace(/${replace}/g, '')
  console.log(newStr);
}

```

Answer: 
The short anser is:

```
var world = "World";
var myString = "Hello World!";
myString.replace(new RegExp(`Hello ${world}`), "Hello Earth");

// Outputs "Hello Earth!"

```

If the content of the string you are searching for is coming as input from the user, you might want to escape it first, so the user cannot insert special RegExp characters and manipulate your regular expression in ways you might not expect.

```
// Escape special RegExp characters
function escapeRegExp(string) {
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}

var world = "World";
world = escapeRegExp(world);
var myString = "Hello World!";
myString.replace(new RegExp(`Hello ${world}`), "Hello Earth");

// Outputs "Hello Earth!"

```
```js
function escapeRegExp(string) {
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

function replace(romanNumeral, replace) {
  var newStr = romanNumeral.replace(new RegExp(escapeRegExp(replace), 'g'), '')
  console.log(newStr);
}

replace("15551", 5)
```