Under remarks, it says
If the type of source implements IList, that implementation is used to obtain the element at the specified index. Otherwise, this method obtains the specified element.
String does not implement IList<T>. Does that mean this will be an O(n) operation if I declare something like,
IEnumerable<char> myString = "stringy";
?
ElementAtwhen applied to a type which is astringwill be an O(N) operation. It does not implementIList<char>and henceElementAtwon’t do any optimizations on it and instead enumerates through theIEnumerable<char>until it reaches the specified index.