adplus-dvertising
frame-decoration

Question

Which of the following statement is correct?

a.

replace() method replaces all occurrences of one character in invoking string with another character

b.

replace() method replaces only first occurrences of a character in invoking string with another character

c.

replace() method replaces all the characters in invoking string with another character

d.

replace() replace() method replaces last occurrence of a character in invoking string with another character

Answer: (a).replace() method replaces all occurrences of one character in invoking string with another character

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following statement is correct?