I have a string that contains several bullet points (•) that I need to access using the javascript indexOf method. I tried just indexOf(•)
and indexOf(U+2022)
, the unicode value, and still am having a -1 return value.
How would I access the bullet points within the string using indexOf?
I have a string that contains several bullet points (•) that I need to access using the javascript indexOf method. I tried just indexOf(•)
and indexOf(U+2022)
, the unicode value, and still am having a -1 return value.
How would I access the bullet points within the string using indexOf?
Share Improve this question edited Mar 30, 2012 at 16:05 zzzzBov 179k56 gold badges327 silver badges371 bronze badges asked Mar 30, 2012 at 15:59 MikeMike 7812 gold badges7 silver badges14 bronze badges1 Answer
Reset to default 7It looks like you're using the wrong unicode syntax:
someString.indexOf('\u2022');
Also, recheck that you're using the correct unicode value for the bullet within the string.