title: Guava, Files.readLines() and white space
body: <p>I have the following code which utilises Guava's Files.readLines() method:</p>
  
  <pre><code>List&lt;String&gt; strings = Lists.newArrayList();
  final File file = new File(filePath);
  if (file.isFile()) {
    try {
      strings= Files.readLines(file, Charsets.UTF_8);
    }
    catch (IOException ioe) {}
  }
  else {
    // File does not exist
  }
  </code></pre>
  
  <p>Once I have my List of String I'd like to test to see if a current String which I am looking at was in the file.</p>
  
  <pre><code>String myString = "foo";
  if (strings.contains(myString)) {
    // Do something
  }
  </code></pre>
  
  <p>However, I'd like to make the code tolerant to the original file contain leading or trailing spaces (i.e. <code>" foo "</code>).</p>
  
  <p>What is the most elegant way of achieving this?</p>