mannevenu26
asked on
How to find special character in Java Script
Hi,
I have string
welcome?page#isexperts
in above string i want to find out '?'
How to find '?' is present in above string.if present how to identify index of that '?'.
can u plz give me javascript code for this
I have string
welcome?page#isexperts
in above string i want to find out '?'
How to find '?' is present in above string.if present how to identify index of that '?'.
can u plz give me javascript code for this
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you mean " \ " ??
the direction is quite important here, I'm talking backslash
the direction is quite important here, I'm talking backslash
btw I edited my initial answer, so please refresh in browser to see the suggested solution,
it's:
var str = "welcome?page#isexperts";
var n = str.search("\\?");
n contains the position of your searched character in the string (accounted for the fact that first character has index=0)
it's:
var str = "welcome?page#isexperts";
var n = str.search("\\?");
n contains the position of your searched character in the string (accounted for the fact that first character has index=0)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for your points
Have a nice day
Duncan
Have a nice day
Duncan
ASKER
Both i triewd with / and without /