This content has been marked as final.
Show 3 replies
-
1. Re: Correct way to search for character within a string
frameexpert Sep 15, 2014 9:40 AM (in response to bobsteamer)Hi Bob, I did not test this, but I think the problem is an unescaped character in your regular expression. Try this.
var mybracketpos = mylistitem.search(/\(/i);
Notice the backslash before the open parens that you are searching for.
-Rick
-
2. Re: Correct way to search for character within a string
Russ Ward Sep 16, 2014 5:39 AM (in response to bobsteamer)If a regular expression isn't required, I would think that indexOf would be easier:
var mybracketpos = mylistitem.indexOf("(");
Russ
-
3. Re: Correct way to search for character within a string
bobsteamer Sep 16, 2014 6:30 AM (in response to Russ Ward)Hi Russ and Rick,
Finger trouble with Rick reply.
They both work perfectly!!
Many thanks to you both.
Bob


