title: How to process a line that has 2 same words
body: <p>I have a line as follows:
  <code>abcde, def, efgh, mnop, mno, pqr, abc, abcde, abcde, mnop, efg</code></p>
  
  <p>In this, <strong>abcde</strong> and <strong>mnop</strong> occur more than once. I want to change the  names of all occurrences of <strong>abcde</strong> and <strong>mnop</strong> so that they are all represented different. </p>
  
  <p>How can I do that without changing the order of the sequence? </p>
  
  <p>Please note that the words that appear more than once (more than twice as well in some cases) are not known. So the need to figure out words appears more than once is to be done. </p>
  
  <p>The line is a String and would want the end result as a String for processing. </p>
  
  <p>Thanks in advance. </p>