最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

unicode - javascript search for bulletpoint using indexOf - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

1 Answer 1

Reset to default 7

It 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.

发布评论

评论列表(0)

  1. 暂无评论