contain
am 12.01.2005 23:11:41 von Darren WoodbreyCould someone please tell me what the asp "contains" operator is? In SQL it
is LIKE. something is like something else! Thanks!
Could someone please tell me what the asp "contains" operator is? In SQL it
is LIKE. something is like something else! Thanks!
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"
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!
>
>
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)