Gossamer Forum
Home : General : Internet Technologies :

Re: [newage24] Javascript question about "indexOf()" function!

Quote Reply
Re: [newage24] Javascript question about "indexOf()" function! In reply to
Hello newage24,

The indexof function is working correctly finding Hon in Honda.

But I suppose that is not what you want.

You would be better using a regular expression to find a whole word only match.

See : http://www.juicystudio.com/...vascript/regexp.html

for explanations and a few examples of how to do this.

See also : http://developer.netscape.com/...e/angus_strings.html

for " Example 1 " which may be close to your desired result.

Hope this helps.

kode

Last edited by:

kode: Oct 15, 2002, 9:19 AM
Subject Author Views Date
Thread Javascript question about "indexOf()" function! newage24 5403 Oct 14, 2002, 1:05 AM
Post Re: [newage24] Javascript question about "indexOf()" function!
Paul 5150 Oct 14, 2002, 2:21 AM
Post Re: [newage24] Javascript question about "indexOf()" function!
cornball 5136 Oct 15, 2002, 8:42 AM
Post Re: [newage24] Javascript question about "indexOf()" function!
cornball 5142 Oct 15, 2002, 10:08 AM