top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Wild Card based Pattern Matching in C# 7.0

0 votes
328 views
What is Wild Card based Pattern Matching in C# 7.0
posted May 12, 2017 by Amit Sharma

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
List<object> objCollection=new List<object>() {10 , 20, null, "hello", 12.5};

foreach( object o in new List<object>() {10 , 20, null, "hello", 12.5})

{
    if( o is *)
     {
Console.WriteLine("Its a match",o);

  }

}

Here * is the wild card that matches all types in C#.

answer May 15, 2017 by Shweta Singh
...