Indexer (programming): Difference between revisions

Content deleted Content added
See also: per WP:SEEALSO, avoid repeating links here that are already linked in the article
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags
Line 14:
| url = http://www.dotnetfunda.com/interview/exam4161-what-is-an-indexer-in-csharp-.aspx}}</ref>
 
<sourcesyntaxhighlight lang="csharp">
class OurFamily
{
Line 52:
}
</syntaxhighlight>
</source>
 
Usage example:
 
<sourcesyntaxhighlight lang="csharp">
void Main()
{
Line 67:
}
}
</syntaxhighlight>
</source>
 
In this example, the indexer is used to get the value at the nth position, and then to get the position in the list referenced by its value.