in , ,

I came across this while doing an online practice test…

I came across this while doing an online practice test... | code-memes, program-memes, test-memes, string-memes, class-memes, c#-memes, console-memes, cs-memes | ProgrammerHumor.io
code-memes, program-memes, test-memes, string-memes, class-memes, c#-memes, console-memes, cs-memes | ProgrammerHumor.io

Content

6. What will be the output of the following C code snippet? class Program static void Main(string args) String s1 "CSHARP"; String s2 s1.Replace(‘H’,’L’); Console.WriteLine(s2); Console.ReadLine); CSHP CSHP CSHALP V Explanation: Replace() method replaces all occurrences of a single character in invoking strings with another character. s1.Replace(‘H’,L’) replaces every occurrence of ‘H’ in SHARP by ‘L’, giving CSHALP. Output: