Press "Enter" to skip to content

Index and Range Operators in C# 8

Patrick Smacchia looks at two new operators in C#:

C#8 added the index ^ and range .. operators. In this post I am attempting to demystify both in the most comprehensive way.

Read on for the demos. I’m not sure I like how the range operator is exclusive on the right-hand side, but I suppose it’s just a matter of remembering that in this language, it’s exclusive and in others it can be inclusive.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.