top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is Wild Card based Pattern Matching in C# 7.0

0 votes
33 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...