Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмахОвај прегледач више није подржан.
Надоградите на Microsoft Edge бисте искористили најновије функције, безбедносне исправке и техничку подршку.
Bypasses elements in a collection as long as a specified condition is true
and then returns the remaining elements.
Skip While expression
Term | Definition |
---|---|
expression |
Required. An expression that represents a condition to test elements for. The expression must return a Boolean value or a functional equivalent, such as an Integer to be evaluated as a Boolean . |
The Skip While
clause bypasses elements from the beginning of a query result until the supplied expression
returns false
. After expression
returns false
, the query returns all the remaining elements. The expression
is ignored for the remaining results.
The Skip While
clause differs from the Where
clause in that the Where
clause can be used to exclude all elements from a query that do not meet a particular condition. The Skip While
clause excludes elements only until the first time that the condition is not satisfied. The Skip While
clause is most useful when you are working with an ordered query result.
You can bypass a specific number of results from the beginning of a query result by using the Skip
clause.
The following code example uses the Skip While
clause to bypass results until the first customer from the United States is found.
Public Sub SkipWhileSample()
Dim customers = GetCustomerList()
' Return customers starting from the first U.S. customer encountered.
Dim customerList = From cust In customers
Order By cust.Country
Skip While IsInternationalCustomer(cust)
For Each cust In customerList
Console.WriteLine(cust.CompanyName & vbTab & cust.Country)
Next
End Sub
Public Function IsInternationalCustomer(ByVal cust As Customer) As Boolean
If cust.Country = "USA" Then Return False
Return True
End Function
.NET повратне информације
.NET је пројекат отвореног кода. Изаберите везу да бисте обезбедили повратне информације:
Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмах