Computer Science, asked by chaitanya9010, 1 year ago

String str1 = "Kolkata".replace('k', 'a');

In the above statement, the effect on string Kolkata is
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

Answers

Answered by choudhary21
0
✔✔{\texttt{Answer}}✔✔
⤵⤵⤵⤵⤵⤵⤵⤵⤵⤵⤵ ıllıllıllıllıllıllııllıllıllıllıllıllııllıllıllıllıllıllı
_______________________

<b>Typing -

B.All characters k are replaced by a.✔

replace() method returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.

Syntax: Here is the syntax of this method:
public String replace(charoldChar, char newChar)
Parameters: Here is the detail of the parameters:

oldChar -- the old character. newChar -- the new character.

Return Value: It returns a string derived from this string by replacing every occurrence of oldChar with newChar.


\huge\boxed{\texttt{\fcolorbox{aqua}{grey}{B}}}

_______________________ ıllıllıllıllıllıllııllıllıllıllıllıllııllıllıllıllıllıllı

<b><big>⭐⭐Hope help You⭐⭐

Answer - By Choudhary21
Answered by varshini1101
0
heya !!


here is your answer⬇️⬇️


Option B is the answer.

hope my answer helps you
Similar questions