【发布时间】:2014-06-11 03:32:45
【问题描述】:
编辑:我详细阐述了我的问题 ..solutions are here for one fix duplicate word ..我被问及每个重复的单词
我是新手...可能不是一个好问题。 ......
这是字符串
string str = "this this is is a a string"
在面试中,我被要求将每个重复关键字的计数存储在通用字典中,然后按顺序显示它们
例如“is”关键字的出现次数为2
类似链接
:
Find the most occurrence of a character in string C#?这是关于寻找角色
Finding occurrences of words in text which are in a list words 这是在 python
Remove occurrences of duplicate words in a stringjavascript 中的 this
How to use the string.match method to find multiple occurrences of the same word in a string? 不相关
..请建议
【问题讨论】:
-
字典包含一个键和一个值。您将需要拆分字符串,并保存字典中每个单词的计数。如果您遇到特定问题,请将您的代码与您遇到的问题一起发布。
-
你的问题很好。你只是没有表现出任何努力去弄清楚。您基本上是在要求 SO 为您编写代码。
-
我简化了我的问题......
标签: c# string dictionary