<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Replace Spaces with Underscores'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 08 Apr 2026 08:22:38 +0000</lastBuildDate>
    <item>
      <title>duniyadnd said on 21/Apr/2009</title>
      <link>https://snipplr.com/view/14206/replace-spaces-with-underscores</link>
      <description>&lt;p&gt;You're missing out a couple of items: because you're using Javascript, keep in mind of &nbsp; ( you can also look at   - I think). Your script also treats multiple spaces/tabs/white spaces as it's own entity, which could lead to undesired results. An alternative is:&#13;
&#13;
var result = str.replace(/(\s|&nbsp;|&\#160;)+/gi, "_");&lt;/p&gt;</description>
      <pubDate>Tue, 21 Apr 2009 20:29:56 UTC</pubDate>
      <guid>https://snipplr.com/view/14206/replace-spaces-with-underscores</guid>
    </item>
    <item>
      <title>duniyadnd said on 21/Apr/2009</title>
      <link>https://snipplr.com/view/14206/replace-spaces-with-underscores</link>
      <description>&lt;p&gt;Ugh, don't know why it didn't show up properly - I've put the code here: http://snipplr.com/view/14252/replace-space-with-/&lt;/p&gt;</description>
      <pubDate>Tue, 21 Apr 2009 20:32:51 UTC</pubDate>
      <guid>https://snipplr.com/view/14206/replace-spaces-with-underscores</guid>
    </item>
  </channel>
</rss>
