contain

contain

am 12.01.2005 23:11:41 von Darren Woodbrey

Could someone please tell me what the asp "contains" operator is? In SQL it
is LIKE. something is like something else! Thanks!

Re: contain

am 12.01.2005 23:24:11 von ten.xoc

Assuming by ASP you mean VBScript (ASP isn't a language):

InStr()

e.g.

<%
if instr("foo-bar-blat-splunge", "bar") > 0 then
response.write "foorbarblat contains 'bar'..."
end if
%>

In JScript I believe you're looking for .indexOf() ...

--
http://www.aspfaq.com/
(Reverse address to reply.)




"Darren Woodbrey" wrote in message
news:OLMSBOP#EHA.2984@TK2MSFTNGP09.phx.gbl...
> Could someone please tell me what the asp "contains" operator is? In SQL
it
> is LIKE. something is like something else! Thanks!
>
>

Re: contain

am 12.01.2005 23:46:25 von exjxw.hannivoort

Darren Woodbrey wrote on 12 jan 2005 in
microsoft.public.inetserver.asp.db:

> Could someone please tell me what the asp "contains" operator is? In
> SQL it is LIKE. something is like something else! Thanks!

ASP is not a language but a platform for languages.

The most "spoken" lscript languagese in ASP are VBscript and J[ava]
script.

There is no "like" operator in those two.

======================

Example how to circumvent that [ASP VBscript]:

<%
t = "Hello World"
s = "Hello"

if instr(t,s)>0 then response.write "Contains [vb]"
%>

========================

And in ASP Jscript [Regex example]:








--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)