<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Capitalize the first character of multi word string</title>
	<atom:link href="http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/</link>
	<description>Ruby on Rails tutorials</description>
	<pubDate>Sun, 07 Sep 2008 00:43:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Yavor Ivanov</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-89</link>
		<dc:creator>Yavor Ivanov</dc:creator>
		<pubDate>Wed, 14 May 2008 18:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-89</guid>
		<description>Hey it's very simple for national characters as well.
If you have problems with local chars just always put the string through chars.
In this case it is simply:

str.chars.upcase.to_s

Greetings from Bulgaria!</description>
		<content:encoded><![CDATA[<p>Hey it&#8217;s very simple for national characters as well.<br />
If you have problems with local chars just always put the string through chars.<br />
In this case it is simply:</p>
<p>str.chars.upcase.to_s</p>
<p>Greetings from Bulgaria!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajat</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-61</link>
		<dc:creator>rajat</dc:creator>
		<pubDate>Thu, 15 Nov 2007 07:52:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-61</guid>
		<description>Very useful,

thanks
</description>
		<content:encoded><![CDATA[<p>Very useful,</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert B.</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-60</link>
		<dc:creator>Robert B.</dc:creator>
		<pubDate>Thu, 11 Oct 2007 15:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-60</guid>
		<description>Preseneted solution with regular expression doesn't take into consideration string with national characters, i.e. not from regular a-z range.</description>
		<content:encoded><![CDATA[<p>Preseneted solution with regular expression doesn&#8217;t take into consideration string with national characters, i.e. not from regular a-z range.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pvh</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-55</link>
		<dc:creator>pvh</dc:creator>
		<pubDate>Tue, 28 Aug 2007 20:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-55</guid>
		<description>How appropriate, the blog ate my whitespace! My example should look like: "Hello____________________world" becoming "Hello_world".</description>
		<content:encoded><![CDATA[<p>How appropriate, the blog ate my whitespace! My example should look like: &#8220;Hello____________________world&#8221; becoming &#8220;Hello_world&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pvh</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-54</link>
		<dc:creator>pvh</dc:creator>
		<pubDate>Tue, 28 Aug 2007 20:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-54</guid>
		<description>Just to clarify David's post, the error in your original function is that it modifies whitespace. It will replace all whitespace with a single space, including tabs or multiple spaces. Thus the string "Hello               world!" will become "Hello World!" using your original function.</description>
		<content:encoded><![CDATA[<p>Just to clarify David&#8217;s post, the error in your original function is that it modifies whitespace. It will replace all whitespace with a single space, including tabs or multiple spaces. Thus the string &#8220;Hello               world!&#8221; will become &#8220;Hello World!&#8221; using your original function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-3</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 06 May 2007 02:32:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-3</guid>
		<description>Thanks for the comment David. 
Actually, the string will be modified, it will just out put a new string with upper case words.

However, I like your solution more, ill add it to the post!</description>
		<content:encoded><![CDATA[<p>Thanks for the comment David.<br />
Actually, the string will be modified, it will just out put a new string with upper case words.</p>
<p>However, I like your solution more, ill add it to the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Felstead</title>
		<link>http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-2</link>
		<dc:creator>David Felstead</dc:creator>
		<pubDate>Sun, 06 May 2007 00:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyonrailsexamples.com/ruby-strings/capitalize-the-first-character-of-multi-word-string/#comment-2</guid>
		<description>This will actually modify the string, so if you had (substituting _ for spaces) "hello___how___are___you" would be replaced with "Hello_How_Are_You", i.e. the spaces are removed.

This might be a better solution:

str.gsub(/^[a-z]&#124;\s+[a-z]/) { &#124;a&#124; a.upcase }</description>
		<content:encoded><![CDATA[<p>This will actually modify the string, so if you had (substituting _ for spaces) &#8220;hello___how___are___you&#8221; would be replaced with &#8220;Hello_How_Are_You&#8221;, i.e. the spaces are removed.</p>
<p>This might be a better solution:</p>
<p>str.gsub(/^[a-z]|\s+[a-z]/) { |a| a.upcase }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
