Thursday, April 18, 2013

is string IEnumerable?


Do you know that string is IEnumerable and it’s a collection of character?
You don’t believe then try a simple code
***************************************************
  string z = "abc";
if (z is IEnumerable)
{
}
 ***************************************************
Or much simpler -> a go to definition for string
 
    public sealed class String : IComparable, ICloneable, IConvertible, IComparableIEnumerableIEnumerable, IEquatable
 

No comments: