How to find and save the common words in a string to a variable