title: Find the same word in two different strings
body: <p>I would like to find same word in two string.</p>
  
  <pre><code>startpoint = newresult.indexOf('\'');
  endpoint = newresult.lastIndexOf('\'');
  
  variables = newresult.substring(startpoint, endpoint);
  variables = variables.replace("\r\n", ",");
  variables = variables.replaceAll("'", "");`
  </code></pre>
  
  <p>String <strong>variables</strong>:</p>
  
  <p>cons,john,$,alex,manag;</p>
  
  <p>String <strong>second</strong>:</p>
  
  <p>ins_manages(john,cons)</p>
  
  <p>As it is seen, both strings they have john and cons and I want to check if both have same char sequences or not but I don't know how it can be checked? Is there any way to check it directly?</p>
  
  <p>Solution: 
  <code>String [] newvar;
  newvar = variables.split(",");</code> </p>
  
  <p>After that, I used a for loop and matched them one by one.  </p>
  
  <p>BR</p>