I have a string Array :
Dim validXLExtns() As String = {"XLS", "XLSX", "XLA", "XLAM", "XLSM", "XLTX", "XLT", ""}
Now, I have to check programmatically if "XLS" exists in the array or not. Ideally, you will like to loop through the items in the array. But, now, with the help of LINQs you can do it with the following command :
Dim product = From s In validXLExtns _
Where s = "XLS"
And if product.count is greater than 0, the value actually exists in the array.
Some very good examples of LINQs:
Developer.com
MSDN LINQ Examples
No comments:
Post a Comment