Which of these functions are used to partially or fully substitute a string?

Which of these functions are used to partially or fully substitute a string?
A. replace()
B. size()
C. subs()
D. substring()
 
Answer: A
Explanation: The replace function works with 3 arguments; the index in the source string, the string to be substituted with, and the string variable. It can be used as “str.replace(a,b, “hello”);” where ‘b’ characters are replaced from index ‘a’ in ‘str’.
 

Tìm kiếm

Back
Top