title: Java. How to remove white space on array
body: <p>For example
  I split a string "+name" by +. I got an white space" " and the "name" in the array(this doesn't happen if my string is "name+").</p>
  
  <pre><code>t="+name";
  String[] temp=t.split("\\+");
  </code></pre>
  
  <p>the above code produces</p>
  
  <pre><code>temp[0]=" "
  temp[1]=name
  </code></pre>
  
  <p>I only wants to get "name" without whitespace..</p>
  
  <p>Also if t="name+" then temp[0]=name.  I'm wondering what is difference between name+ and +name. Why do I get different output.</p>