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

Popular posts from this blog

python - Strange behavior using PyQt4's 'pyqtSlot' decorator before another decorator -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

c# - Process.Kill() returns access denied -