title: javascript trim() doesn't work
body: <p>i'm trying to trim down a string before removing parts of it, but there's something off about the spaces in the string.</p>
  
  <p>the string i'm trying to trim is this</p>
  
  <pre><code>        200    KristianMedK                                                                fisk                                                         {dropdownbegin}                                  Ikke valgt                        fisk                        fugl                                                dinosaur                                                kristian                                                         {dropdownend}                                                                        Ikke valgt                                                                {dropdownbegin}                                  Ikke valgt                                            KristianMedK                       Laks                       TunMedT                       lasse                           {dropdownend}                    
  </code></pre>
  
  <p>the string is being returned from the .text() method of an element in the tablesorter jquery library.
  I've already filtered out a bunch of ↵ characters from the string by </p>
  
  <pre><code>mystring = mystring.replace(/\n/g, "")
  </code></pre>
  
  <p>using </p>
  
  <pre><code>mystring= mystring.replace(" ","") 
  </code></pre>
  
  <p>made no difference either. </p>
  
  <p>How can i find out where if any otoher special characters is hiding in the string messing with the javascript?</p>
  
  <p>my end goal is removing the content between the {dropdownbegin} and {dropdownend} but the substring i get when getting indexof is wrong and includes some of the text after the {dropdownend}</p>
  
  <pre><code>    var index1 = text.indexOf("{dropdownbegin}");
      var index2 = text.indexOf("{dropdownend}");
      var substr = text.substr(index1, index2);
      text = text.replace(substr, "");
  </code></pre>
  
  <p>the above code gives the substring </p>
  
  <pre><code>{dropdownbegin} Ikke valgt fisk fugl dinosaur kristian {dropdownend} Ikke valg
  </code></pre>
  
  <p>for reasons i do not know.</p>
  
  <p>EDIT the trim issue was solved quickly as i failed to search properly for existing questions.</p>