Re: If value is in a list
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Thu, 24 Apr 2008 01:14:21 +0200
Tom Cole wrote:
Just to toss another option out there...what about RegExp?
Is there a point in your repeating your suggestion ...
function doCheck(value, array) {
return (new RegExp('^(' + array.join('|') + ')$').test(value));
}
.... already made in
<news:c62a5dd5-58b6-4218-a4d9-30623c0c5bc2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>?
Send it the value to look for and the array of values...
See <news:480E6AB3.40300@xxxxxxxxxxxxxx>.
And please trim your quotes.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
.
- Follow-Ups:
- Re: If value is in a list
- From: Tom Cole
- Re: If value is in a list
- References:
- If value is in a list
- From: Mike
- Re: If value is in a list
- From: Dr J R Stockton
- Re: If value is in a list
- From: Tom Cole
- If value is in a list
- Prev by Date: Re: If value is in a list
- Next by Date: Re: If value is in a list
- Previous by thread: Re: If value is in a list
- Next by thread: Re: If value is in a list
- Index(es):
Relevant Pages
|