You need to cast to IList explicitly, as it is "hidden" interface
implementation:

 string[] x = new string[]{"a", "b"};
 Console.WriteLine(((IList)x).Contains("b"));

(should work, though I didn't test)

2007/1/15, Chris Seaton <[EMAIL PROTECTED]>:
> System.Array has a Contains() method doesn't it? System.Array
> implements System.Collections.IList and I see the implementation in
> Array.cs, but when I try
>
> string[] x = new string[]{"a", "b"};
> Console.WriteLine(x.Contains("b"));
>
> I get
>
> error CS0117: `string[]' does not contain a definition for `Contains'
>
> What's wrong? Using gmcs with latest mono release.
>
> Thanks
>
> Chris Seaton
> _______________________________________________
> Mono-list maillist  -  [email protected]
> http://lists.ximian.com/mailman/listinfo/mono-list
>


-- 
Kamil Skalski
http://nazgul.omega.pl
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to