<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: String.Capitalize in C# (PHP&#8217;s ucwords in C#)</title>
	<atom:link href="http://www.daniel-skinner.co.uk/php-ucwords-in-c/25/02/2009/feed" rel="self" type="application/rss+xml" />
	<link>http://www.daniel-skinner.co.uk/php-ucwords-in-c/25/02/2009</link>
	<description>Daniel Skinner&#039;s Blog: Web Development news and articles</description>
	<lastBuildDate>Sun, 10 Jan 2010 12:26:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: julio</title>
		<link>http://www.daniel-skinner.co.uk/php-ucwords-in-c/25/02/2009/comment-page-1#comment-11965</link>
		<dc:creator>julio</dc:creator>
		<pubDate>Wed, 07 Oct 2009 16:32:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=31#comment-11965</guid>
		<description>I suggest adding ToLower() the the last part so it also converts &quot;tHIS sENTENCE&quot; to &quot;This Sentence&quot; rather than &quot;THIS SENTENCE.

i.e.

public static string Capitalize(this String s)
{
  return s.ToCharArray().Aggregate(String.Empty,
    (working, next) =&gt;
      working.Length == 0 &amp;&amp; next != &#039; &#039; ? next.ToString().ToUpper() : (
        working.EndsWith(&quot; &quot;) ? working + next.ToString().ToUpper() :
          working + next.ToString().ToLower()
    )
  );
}</description>
		<content:encoded><![CDATA[<p>I suggest adding ToLower() the the last part so it also converts &#8220;tHIS sENTENCE&#8221; to &#8220;This Sentence&#8221; rather than &#8220;THIS SENTENCE.</p>
<p>i.e.</p>
<p>public static string Capitalize(this String s)<br />
{<br />
  return s.ToCharArray().Aggregate(String.Empty,<br />
    (working, next) =&gt;<br />
      working.Length == 0 &amp;&amp; next != &#8216; &#8216; ? next.ToString().ToUpper() : (<br />
        working.EndsWith(&#8221; &#8220;) ? working + next.ToString().ToUpper() :<br />
          working + next.ToString().ToLower()<br />
    )<br />
  );<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.daniel-skinner.co.uk/php-ucwords-in-c/25/02/2009/comment-page-1#comment-5378</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Sun, 22 Mar 2009 10:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=31#comment-5378</guid>
		<description>That is also a possibility but the functionality of the two methods are not the same (in principle).

However, the behaviour of that method may change in the future. A more accurate ToTitleCase method would change &quot;war and peace&quot; to &quot;War and Peace&quot; and so the functionality of the ToTitleCase method will improve in future releases.

The Captialize function I provided is meant to change &quot;war and peace&quot; to &quot;War And Peace&quot;.</description>
		<content:encoded><![CDATA[<p>That is also a possibility but the functionality of the two methods are not the same (in principle).</p>
<p>However, the behaviour of that method may change in the future. A more accurate ToTitleCase method would change &#8220;war and peace&#8221; to &#8220;War and Peace&#8221; and so the functionality of the ToTitleCase method will improve in future releases.</p>
<p>The Captialize function I provided is meant to change &#8220;war and peace&#8221; to &#8220;War And Peace&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pravin</title>
		<link>http://www.daniel-skinner.co.uk/php-ucwords-in-c/25/02/2009/comment-page-1#comment-5276</link>
		<dc:creator>Pravin</dc:creator>
		<pubDate>Thu, 19 Mar 2009 16:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=31#comment-5276</guid>
		<description>here is better way
http://www.aspdotnetfaq.com/Faq/How-to-Capitalize-the-First-Letter-of-All-Words-in-a-string-in-C-sharp.aspx</description>
		<content:encoded><![CDATA[<p>here is better way<br />
<a href="http://www.aspdotnetfaq.com/Faq/How-to-Capitalize-the-First-Letter-of-All-Words-in-a-string-in-C-sharp.aspx" rel="nofollow">http://www.aspdotnetfaq.com/Faq/How-to-Capitalize-the-First-Letter-of-All-Words-in-a-string-in-C-sharp.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
