查找字谜 JavaScript jQuery
假设我有一个像
Dog 这样的列表 狗 上帝 狗 狗狗 斑马 Wood
我想做的是找到列表中的所有单词,无论大小写,或者无论实际单词如何。我想匹配字母并计数。因此,从上面开始,
Dog、dOg、God 都是匹配项,在这种情况下将返回“3”作为计数,但 Doggy、dogg、zebra、wood.. 都将是唯一的,并且都将返回 1 作为计数。虽然我知道这是可能的,但我不知道从哪里开始。字谜概念让我有点困惑。有什么想法吗?
Lets Say I have a list like
Dog
dOg
God
doggy
dogg
Zebra
Wood
What I want to do is find all the words in the list regardless of case, or regardless of the actual word. I want to match the letters and take a count. So from above
Dog, dOg, God would all be a match and in this case would return "3" as the count, but doggy, dogg, zebra, wood.. would all be unique and all would return 1 as the count.. Though I know this is possible I don't know where to begin. The anagram concept throws me off a bit. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是我想出的... jsfiddle 这里
here's what I came up with... jsfiddle here