<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://professionalaspnet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Parsing Capital Letters</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx</link><description>I found an intersting question on the ASP.NET forums this morning. How can you get a count of the capital letters in a string? My first thought was, &amp;#39;This is a Job for Regex!&amp;#39;. If you are not familiar with regular expressions, please get to know</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>Dew Drop &amp;#8211; October 2, 2009 | Alvin Ashcraft&amp;#039;s Morning Dew</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx#54666</link><pubDate>Fri, 02 Oct 2009 12:47:37 GMT</pubDate><guid isPermaLink="false">9f8c9708-cda3-4e3e-8e5b-ee2a54f50e19:54666</guid><dc:creator>Dew Drop – October 2, 2009 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2009/10/02/dew-drop-october-2-2009/"&gt;http://www.alvinashcraft.com/2009/10/02/dew-drop-october-2-2009/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Parsing Capital Letters</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx#54687</link><pubDate>Fri, 02 Oct 2009 19:42:14 GMT</pubDate><guid isPermaLink="false">9f8c9708-cda3-4e3e-8e5b-ee2a54f50e19:54687</guid><dc:creator>Scott Mitchell</dc:creator><description>LINQ chews through problems like this with a minimal number of characters and, some would argue, better readability than regular expressions.

crazyString.ToCharArray().Count(c =&gt; char.IsUpper(c));

Also, no magic strings needed.</description></item><item><title>re: Parsing Capital Letters</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx#54941</link><pubDate>Mon, 05 Oct 2009 19:28:50 GMT</pubDate><guid isPermaLink="false">9f8c9708-cda3-4e3e-8e5b-ee2a54f50e19:54941</guid><dc:creator>Chris Love</dc:creator><description>&lt;p&gt;Come on Scott, you know Regex are always awesome, just see this example ;) &lt;a rel="nofollow" target="_new" href="http://thedailywtf.com/Articles/RegExp-From-Down-Under.aspx"&gt;http://thedailywtf.com/Articles/RegExp-From-Down-Under.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Parsing Capital Letters</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx#55129</link><pubDate>Tue, 06 Oct 2009 22:26:38 GMT</pubDate><guid isPermaLink="false">9f8c9708-cda3-4e3e-8e5b-ee2a54f50e19:55129</guid><dc:creator>Charli</dc:creator><description>Depends on how often this function is called, but I would recomend to avoid regexp when possible. The most nice looking solution is not always the best solution! (mostly it's the worst solution)

From experience I know that RegExp is awfully &gt;&gt;&gt; SLOW &lt;&lt;&lt; and should be avoided when possible.. Better to build a function that loops through the string and counts if it's upper case or not! probably will take you the same amount of time to write, so why not?</description></item><item><title>re: Parsing Capital Letters</title><link>http://professionalaspnet.com/archive/2009/10/01/Parsing-Capital-Letters.aspx#55219</link><pubDate>Wed, 07 Oct 2009 14:47:29 GMT</pubDate><guid isPermaLink="false">9f8c9708-cda3-4e3e-8e5b-ee2a54f50e19:55219</guid><dc:creator>Chris Love</dc:creator><description>&lt;p&gt;Charli you can't be serious! If it were not for regular expressions SPAM filters, browsers, etc could not function as fast as they do. Regex are very fast and efficient.&lt;/p&gt;
</description></item></channel></rss>