<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>blog.knapo.net - Programming Comments</title>
  <id>tag:blog.knapo.net,2010:mephisto//comments</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://blog.knapo.net/feed/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.knapo.net/" rel="alternate" type="text/html"/>
  <updated>2010-08-22T19:51:29Z</updated>
  <entry xml:base="http://blog.knapo.net/">
    <author>
      <name>Online Form</name>
    </author>
    <id>tag:blog.knapo.net,2010-01-12:11:188</id>
    <published>2010-08-22T19:51:29Z</published>
    <updated>2010-08-22T19:51:29Z</updated>
    <link href="http://blog.knapo.net/2010/1/12/my-improvements-on-latest-i18n-gem" rel="alternate" type="text/html"/>
    <title>Comment on 'my improvements on latest i18n gem' by Online Form</title>
<content type="html">&lt;p&gt;hey man I like it. I&#8217;m ready to write more articles and put your ideas to the test. After all, we always have something new to learn and being humble, I came here to learn. Bookmarked.&lt;/p&gt;


	&lt;p&gt;- John&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://blog.knapo.net/">
    <author>
      <name>adepev</name>
    </author>
    <id>tag:blog.knapo.net,2010-01-21:14:146</id>
    <published>2010-06-22T10:30:57Z</published>
    <updated>2010-06-22T10:30:57Z</updated>
    <link href="http://blog.knapo.net/2010/1/21/string-tr-vs-string-gsub" rel="alternate" type="text/html"/>
    <title>Comment on 'String#tr vs String#gsub' by adepev</title>
<content type="html">&lt;p&gt;Very nice post! Thank you, admin!&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://blog.knapo.net/">
    <author>
      <name>knapo</name>
    </author>
    <id>tag:blog.knapo.net,2010-01-21:14:33</id>
    <published>2010-03-06T10:43:52Z</published>
    <updated>2010-03-06T10:43:52Z</updated>
    <link href="http://blog.knapo.net/2010/1/21/string-tr-vs-string-gsub" rel="alternate" type="text/html"/>
    <title>Comment on 'String#tr vs String#gsub' by knapo</title>
<content type="html">&lt;p&gt;Thanks Bruno for noticing my mistake, you&#8217;re right. Of course, I agree that they work different way, but in simple cases (which are most common) they have the same results. Both can do the things, which would be very tricky do with the second one (as you presented):&lt;/p&gt;


	&lt;p&gt;e.g.
&#8220;hello&#8221;.tr(&#8216;a-y&#8217;, &#8216;b-z&#8217;)
&#8220;hello&#8221;.gsub(/([aeiou])/, &#8216;&amp;lt;\1&amp;gt;&#8216;)&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://blog.knapo.net/">
    <author>
      <name>Jos&#233; Valim</name>
    </author>
    <id>tag:blog.knapo.net,2010-01-12:11:31</id>
    <published>2010-03-03T15:50:22Z</published>
    <updated>2010-03-03T15:50:22Z</updated>
    <link href="http://blog.knapo.net/2010/1/12/my-improvements-on-latest-i18n-gem" rel="alternate" type="text/html"/>
    <title>Comment on 'my improvements on latest i18n gem' by Jos&#233; Valim</title>
<content type="html">&lt;p&gt;Thank you for working on it and making it even better! :)&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://blog.knapo.net/">
    <author>
      <name>Bruno Michel</name>
    </author>
    <id>tag:blog.knapo.net,2010-01-21:14:30</id>
    <published>2010-02-27T20:09:18Z</published>
    <updated>2010-02-27T20:09:18Z</updated>
    <link href="http://blog.knapo.net/2010/1/21/string-tr-vs-string-gsub" rel="alternate" type="text/html"/>
    <title>Comment on 'String#tr vs String#gsub' by Bruno Michel</title>
<content type="html">&lt;p&gt;Hi,&lt;/p&gt;


	&lt;p&gt;I just want to warn you that your two examples are not exactly similar:&lt;/p&gt;


&lt;blockquote&gt;
	&lt;blockquote&gt;
	&lt;p&gt;&#8220;heloo knapo&#8221;.tr(&#8216;o&#8217;,&#8217;ik&#8217;)
	=&amp;gt; &#8220;helii knapi&#8221; 
	&#8220;heloo knapo&#8221;.gsub(&#8216;o&#8217;,&#8217;ik&#8217;)
	=&amp;gt; &#8220;helikik knapik&#8221;&lt;/p&gt;

	&lt;/blockquote&gt;



&lt;/blockquote&gt;




	&lt;p&gt;But tr also have some other capabilities, like swapping &#8216;i&#8217; and &#8216;o&#8217;:&lt;/p&gt;


&lt;blockquote&gt;
	&lt;blockquote&gt;
	&lt;p&gt;&#8220;heloo knapi&#8221;.tr(&#8216;io&#8217;,&#8217;oi&#8217;)
	=&amp;gt; &#8220;helii knapo&#8221;&lt;/p&gt;

	&lt;/blockquote&gt;



&lt;/blockquote&gt;</content>  </entry>
</feed>
