Steven Giesel 6/17/2023

C# 12: Collection literals

Read Original

This article details the new 'collection literals' feature in C# 12, which introduces a terse syntax like [e1, e2, e3] for creating common collection values. It covers the spread operator (..) for inlining collections, planned support for dictionaries, and how custom collections can implement the feature via CollectionBuilder.

C# 12: Collection literals

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes