The string
class implements an indexer that allows the individual characters of a string to be accessed. The indexer of the string
class has the following declaration:
public char this[int index] { get; }
In other words, a read-only indexer that takes a single argument of type int
and returns an element of type char
. Values passed for the index
argument must be greater than or equal to zero and less than the length of the string.