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: