205k views
3 votes
The string expression strVar.____________________ starts at index pos, replaces the next n characters of strVar with all the characters of str.

User Ndronen
by
6.3k points

1 Answer

4 votes

Answer:

strVar.replace(pos, n, str);

Step-by-step explanation:

The strVar.replace() is a javascript function of searching and replacing a string for a defined value, whereby it finds and returns a new string where the defined values are replaced.

For example: to return a string where "Trump" is replaced with "Biden":

We have

var str = "Welcome Trump!";

var res = str.replace("Trump", "Biden", str);

Hence, in this case, the correct answer is strVar.replace(pos, n, str);

User Theodor
by
7.0k points