title: String.contains function not working
body: <p>I have to check whether the words from File1 exist in File2 or not and then count. Data in both files is shown below.</p>
  
  <p>The words in File1 are like shown below:</p>
  
  <ol>
  <li>发表</li>
  <li>发愁</li>
  <li>发达 </li>
  <li>发抖</li>
  <li>发挥</li>
  </ol>
  
  <p>The data in File2 is like shown below:</p>
  
  <ol>
  <li>这篇论文是什么时候发表的？</li>
  <li>91 ．数据 删掉 被马工程师 了</li>
  <li>92 ．驾驶 酒后 很大 危害</li>
  <li>93 ．客观地 要 他人 评价</li>
  <li>94 ．我不小心 水壶 打翻 了 把</li>
  </ol>
  
  <p>The code I have written is as follows:</p>
  
  <pre><code>File file1 = new File("ChineseWord.txt");
          Scanner sc = new Scanner(new FileInputStream(file1));
          ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
          ArrayList&lt;String&gt; newList = new ArrayList&lt;String&gt;();
  
          while(sc.hasNext()){
                  list.add(sc.next());
          }
  
          sc.close();
  
          File file2 = new File("RandomData.txt");
  
          Scanner newScanner = new Scanner(new FileInputStream(file2));
  
          int count = 0;
  
          for (int i = 0; i &lt; list.size(); i++) {
  
              while(newScanner.hasNext()){
  
                  String word = newScanner.nextLine();
                  String toMatch = list.get(i);
  
                  if(word.contains(toMatch)){
                      System.out.println("Success");
                      count++;
                  }
  
  
              }
  
              String test = list.get(i);
              newList.add(test+"exists" + count+ "times");
              count =0;
  
          }
  </code></pre>
  
  <p>The question is that it returns 0 for all words whereas the very first word in File1 exists in the very first line of File2. If I manually do something like this </p>
  
  <pre><code>if(word.contains("发表")){
                          System.out.println("Success");
                          count++;
                      }
  </code></pre>
  
  <p>It prints successs otherwise it does not ? Why is this so?</p>