Examveda

What will be the output of the following C# code snippet?
{
    delegate string F(string str);
    class sample
    {
        public static string fun(string a)
        {
            return a.Replace(',''-');
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            F str1 = new F(sample.fun);
            string str = str1("Test Your c#.NET skills");
            Console.WriteLine(str);
        }
    }
}

A. Test Your

B. Test-Your-C#.NET-Skills

C. ur C#.NET Skills

D. None of the mentioned

Answer: Option B


Join The Discussion

Related Questions on Delegates and Events in C Sharp