title: Splitting string with repeating of for loop is not returing properly
body: <p>This is  a basic question, but I am facing one issue. I have one ArrayList and one string. I want to split the string based on the values in the list. But its not working properly.</p>
  
  <pre><code> for (int i=0;i&lt;tagNameList.size();i++)
          {
  
              words=text.split(tagNameList.get(i));
              Log.e("tagname","tagName"+tagNameList.get(i)+"\n"+words.length);
          }
          for (int i=0;i&lt;words.length;i++){
              Log.e("New Words","New Words"+words[i]);
          }
  </code></pre>
  
  <p>This is my code. For example my arraylist tagNameList has values of (@aryan, @aryan , @Lord Jaganadham temple) and my string is "Hi @Aryan check API response @Aryan  upload code at @Lord Jaganadham temple).... But if i am looping the arraylist my output is "Hi @Aryan check API response @Aryan  upload code at "
  But expected output is:</p>
  
  <p>Hi </p>
  
  <p>check API response</p>
  
  <p>upload code at </p>
  
  <p>Any please help me. Thanks in advance</p>