6 Replies Latest reply on Oct 8, 2015 3:20 PM by Shawnny Canuck

    How Do I Trim White Space Before/After Bookmarks?

    Shawnny Canuck



      I am hoping someone can help me with some JavaScript to eliminate the white space before and after my bookmarks. I know I have to use regular expressions which I believe would be ^[ \t]+|[ \t]+$ and I also found some code on the internet but it is related to strings not bookmarks. How would I alter this code to work for bookmarks? Thanks.


      // Trim
      function trim(stringToTrim){
      return stringToTrim.replace(/^\s+|\s+$/g,””);