Hidden gems in List Pattern

In this blog post, we will explore few hidden gems in list patterns , which was introduced with C# 11. List Pattern allows us to check patterns in arrays or list. Assign Variable You can assign variables using pattern, provided the pattern matches. For example, var arr = new [] {1,2,3,4,5}; if(arr is [_,2,var third,..] match) { … Continue reading Hidden gems in List Pattern