Gets the character at a specified position.
[Visual Basic] Public Default ReadOnly Property Chars( _ ByVal index As Integer _ ) As Char [C#] public char this[ int index ] {get;} [C++] public: __property __wchar_t get_Chars(int index); [JScript] returnValue = StringObject.Chars(index);
Exception Type | Condition |
---|---|
ArgumentException | If the character is not at that position in the string. |
This indexer gets a character from a specified position in the string and returns it. If the charcter at the specified position doesn't match the index parameter than an exception is thrown.
String Class | String Members | System Namespace | Char | Int32