asp.net - Combining multiple IndexOf -
Is there a way to combine multiple indexes () to make it more compact?
String as a slow UserAgent = HttpContext.Current.Request.UserAgent if not (UserAgent.IndexOf ("chrome")> 1) OrElse (UserAgent.IndexOf ("Safari ")> -1) Then, 'this end if
you enter instead of can use indexOf
and a collection to view:
dim browser = {"chrome", "safari"} if not browser . If any (function (b) UserAgent.Contains (b)) then terminate with
or query syntax:
dim matching browser = browser In the browser, where UserAgent.Contains (Browser) is not MailBurners. If any () then end
Comments
Post a Comment