主题:求助:字符串问题
你好,我有一个字符串,名字叫 s
请问:如何得出里面每个单词出现的个数呢(及频率)?
比如:有个s="this is a test to get the frequency of the words, how to do it"
然后
this 1
is 1
a 1
test 1
to 2
get 1
the 2
frequency 1
of 1
words 1
how 1
do 1
it 1
麻烦做的给点思路,非常感谢~~~
请问:如何得出里面每个单词出现的个数呢(及频率)?
比如:有个s="this is a test to get the frequency of the words, how to do it"
然后
this 1
is 1
a 1
test 1
to 2
get 1
the 2
frequency 1
of 1
words 1
how 1
do 1
it 1
麻烦做的给点思路,非常感谢~~~