java - String matching operation -


I have two strings (they can be anything) like I'm a boy and < Code> I'm a man where I'm one is normal My job is to find common words with two stars.

I set to store the data & lt; String & gt; , but it only stores unique values, so my question is, how can I get general words from two strings?

The above two sentences, for example, should produce the result {"I", "am", "a"} , that is, the set of general words for both sentences.

set a & lt; String & gt; Better use that stores the frequency number for each word.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -