<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q" -->

---
title: C# Tip: Access items from the end of the array using the...
description: The C# index-from-end operator (^) lets you access array elements counting from the end without manually computing Length minus an offset, e.g. values[^3]...
canonical: https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: C# Tip: Access items from the end of the array using the ^ operator | daily.dev
og:description: The C# index-from-end operator (^) lets you access array elements counting from the end without manually computing Length minus an offset, e.g. values[^3]...
og:url: https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q
og:image: https://api.daily.dev/og/posts/CvXT0xf6Q.png
og:image:alt: C# Tip: Access items from the end of the array using the ^ operator
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C# Tip: Access items from the end of the array using the ^ operator

**[Code4IT](https://daily.dev/sources/code4it)** · 3 min read · 0 upvotes · 0 comments

## Summary

The C# index-from-end operator (^) lets you access array elements counting from the end without manually computing Length minus an offset, e.g. values[^3] instead of values[values.Length - 3]. It's purely syntactic sugar with no performance impact since the compiled IL is identical. Positions are 1-based, so values[^1] returns the last element and values[^0] throws an IndexOutOfRangeException.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.code4it.dev/csharptips/access-items-from-end-of-array>

## Questions this post answers

### How do I access an array element counting from the end in C#?

Use the ^ operator instead of subtracting from Length, e.g. values[^3] returns the third element from the end, equivalent to values[values.Length - 3]. The compiled IL for both forms is identical, so there's no performance difference, only improved readability. The index is 1-based: values[^1] is the last element, and values[^0] throws an IndexOutOfRangeException.

_Developers tightening up array indexing patterns can find more C# syntax tips curated on daily.dev._

## Similar posts on daily.dev

- [The best new features of C\# 14](https://daily.dev/posts/the-best-new-features-of-c-14-6gsbbjwv4) · InfoWorld · 46 upvotes · 4 comments
- [Indexer extension members in C\# 15](https://daily.dev/posts/indexer-extension-members-in-c-15-yabwnagyx) · Damir's Corner · 17 upvotes · 2 comments
- [Correctly Check and Use Nullable Variables in C\#](https://daily.dev/posts/correctly-check-and-use-nullable-variables-in-c--cd8jjz6rq) · Atomic Spin · 11 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"C# Tip: Access items from the end of the array using the ^ operator","url":"https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q"},"datePublished":"2026-10-04T13:07:03.308Z","dateModified":"2026-10-04T13:15:15.312Z","description":"The C# index-from-end operator (^) lets you access array elements counting from the end without manually computing Length minus an offset, e.g. values[^3]...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/684b2083cd67436990aedac0e1f55a38?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/684b2083cd67436990aedac0e1f55a38?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Code4IT","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Code4IT","logo":"https://media.daily.dev/image/upload/s--OaaG4G10--/f_auto,q_auto/v1791119049/logos/code4it?_a=BAMAMicg0","url":"https://daily.dev/sources/code4it"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,c#","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code4IT","item":"https://daily.dev/sources/code4it"},{"@type":"ListItem","position":3,"name":"C# Tip: Access items from the end of the array using the ^ operator"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/c-tip-access-items-from-the-end-of-the-array-using-the-operator-cvxt0xf6q#faq","mainEntity":[{"@type":"Question","name":"How do I access an array element counting from the end in C#?","acceptedAnswer":{"@type":"Answer","text":"Use the ^ operator instead of subtracting from Length, e.g. values[^3] returns the third element from the end, equivalent to values[values.Length - 3]. The compiled IL for both forms is identical, so there's no performance difference, only improved readability. The index is 1-based: values[^1] is the last element, and values[^0] throws an IndexOutOfRangeException. Developers tightening up array indexing patterns can find more C# syntax tips curated on daily.dev."}}]}
```

