PDA

View Full Version : instr or equivelant.


Mhtml
02-19-2003, 06:55 AM
Is there an equivelant of instr() for JS?

What I'm doing is using split() to put a sentence into an array. Now I want to look through that array and replace certain words with other words but I'm unsure how to do it without a lot of elseif() (or whatever my brain is in ASP mode at the mo.)

Anyways is there an instr() or at least a way to do this with minimal code.

A1ien51
02-19-2003, 07:00 AM
it has to be done with regular expressions

A=str.replace();

I am very bad at it, you can do a quick search of the forum, and I am sure you can find an explaination somewhere.

A1ien51

Mhtml
02-19-2003, 07:37 AM
Will do, thanks. :)