Q. Which method replaces a substring?

A
replace()
B
sub()
C
change()
D
swap()
Solution:

replace() replaces a substring, e.g., ‘hi hi’.replace(‘hi’, ‘hello’) = ‘hello hello’.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!