Craig Johnston Craig Johnston - 1 year ago 116
C# Question

C#: how to get first char of a string?

Can the first

char
of a string be retrieved by doing the following?

MyString.ToCharArray[0]

Answer Source

Just MyString[0]. This uses the String.Chars indexer.