how to trim() String in List<String> using JAVA 8 Lambda expression
<p>I am looking for all type of string manipulation using java 8 Lambda expressions.</p>

<p>I first tried the <code>trim()</code> method in simple <code>String</code> list.</p>

<pre><code>String s[] = {" S1","S2 EE ","EE S1 "};
List&lt;String&gt; ls = (List&lt;String&gt;) Arrays.asList(s);
ls.stream().map(String :: trim).collect(Collectors.toList());
System.out.println(ls.toString());
</code></pre>

<p>For this example, I was expecting to get <code>[S1, S2 EE, EE S1]</code>,
but I got <code>[ S1, S2 EE , EE S1 ]</code>.</p>