Q. What does the following string do to given string str1.

Code:
String str1 = “chandrakant”.replace(‘c’,’s’);
  • (A) Replaces single occurance of c to s
  • (B) Replaces all occurance of c to s
  • (C) Replaces single occurance of s to c
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (B) Replaces all occurance of c to s

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
640
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Chandrakant
Publisher
πŸ“ˆ
96%
Success Rate