1.

Which of these functions are used to partially or fully substitute a string?(a) replace()(b) size()(c) subs()(d) substring()This question was posed to me in an online quiz.I would like to ask this question from String Manipulation topic in portion Arduino Programming of Arduino

Answer»

Right answer is (a) replace()

BEST 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’.



Discussion

No Comment Found

Related InterviewSolutions