title: how to get image name and alt attr and then find and replace characters in it
body: <p>While i am trying to generate the names for the images in my blog using jscript </p>
  
  <pre><code>$img.attr('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
  </code></pre>
  
  <p>i am getting the name of the image containing dashes and plus. My question is to get the name without dasshes and plus and insterd of characters i want to get spaces. can any one make it possibble.
  the entire code looks like this</p>
  
  <pre><code>&lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'/&gt;
  &lt;script type='text/javascript'&gt;
  //&lt;![CDATA[
  $(document).ready(function()
  {
  $('img').each(function()
  {
  var $img = $(this);
  var filename = $img.attr('src')
  $img.attr('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
  $img.attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
  $img.attr('title', filename.replace("+"," "));
  });
  });
  //]]&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the complete script and i wanted to know how to avoid special char from the image name while getting it and replacing the special char with spaces.</p>
  
  <p>It must be placed just after  section in a blogger html code.</p>