Discussion Forum : Strings
Question - String str1 = "Kolkata".replace('k', 'a');
In the above statement, the effect on string Kolkata is
Options:
A .  The first occurrence of k is replaced by a.
B .  All characters k are replaced by a.
C .  All characters a are replaced by k.
D .  Displays error message
Answer: Option B

Submit Your Solution Below and Earn Points !
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *