|
|||
|
I'm not having any luck trying to use the search method.
I have tried may different ways to get it to work but still always get '-1' as my result. What am I doing wrong? istest = new String('I am a hairy cat'); var name = 'cat'; var result = istest.search('cat'); trace('cat: ' + result); I get '-1' even if I use: var result = istest.search(name); Any ideas? Also the example for match does not even use match. |
|
|||
|
search works with an instance of a regular Expression (just let Topcmm tell u what is that).
try this: istest = 'I am a hairy cat'; s = /cat/i r = istest.search(s) trace(r) u can also use if (istest.indexOf('cat')!=-1) bla...bla Madcha
__________________
http://www.alyze.com - http://www.ecomzone.net - http://www.alisook.com -http://www.madcha.com - http://www.i-multimedia.fr - |
|
|||
|
Quote:
U can download from the microsoft web site the full documentation about Jscript 5 dot something. As the SWFKIT's script core is the same (among myself...no warranty at all about that ;D ) as the official Jscript you may find that doc usefull. Apache Madcha
__________________
http://www.alyze.com - http://www.ecomzone.net - http://www.alisook.com -http://www.madcha.com - http://www.i-multimedia.fr - |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|