I am trying to find a way to trim spaces from the start and end of the title string. I was using this, but it doesn\'t seem to be working:
title = title.repl
If using jQuery is an option:
/** * Trim the site input[type=text] fields globally by removing any whitespace from the * beginning and end of a string on input .blur() */ $('input[type=text]').blur(function(){ $(this).val($.trim($(this).val())); });
or simply:
$.trim(string);