title: Scala's contain method of String class doesn't find a string with a new line at the end. Why?
body: <p>I've got a txt file with following contents:</p>
  
  <blockquote>
    <p>abc<p></p>
  </blockquote>
  
  <p>I made the file with Notepad and saved it in UTF-8. Calling the following function with <code>"abc"</code> from Scala Interpreter yields <code>false</code> The function searches the txt file with the string+final character of file.</p>
  
  <pre><code>def isWordKnown(word: String):Boolean={
      val inputStreamFromKnownWordsList=new FileInputStream("D:\\WordTracker\\new english\\test.txt")
  
      var stringWriter=new StringWriter()
      IOUtils.copy(inputStreamFromKnownWordsList,stringWriter,"UTF-8")
      val knownWordsString=stringWriter.toString()
      val endOfLine=knownWordsString.substring(knownWordsString.length()-1, knownWordsString.length())
      return knownWordsString.contains(word+endOfLine)
    }
  </code></pre>