<?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: [REPOST] &#8211; Local Method Practical Example</title>
	<atom:link href="http://www.developingfor.net/net-35/local-method-practical-example.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.developingfor.net/net-35/local-method-practical-example.html</link>
	<description>Real World .NET Methods, Tricks, and Examples</description>
	<lastBuildDate>Thu, 11 Mar 2010 18:24:27 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: uguccione</title>
		<link>http://www.developingfor.net/net-35/local-method-practical-example.html/comment-page-1#comment-550</link>
		<dc:creator>uguccione</dc:creator>
		<pubDate>Wed, 06 Aug 2008 16:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.developingfor.net/?p=94#comment-550</guid>
		<description>2 little suggestion:
- StringBuilder is mutable so you can add ever the comma and then check if the string builder have a comma at the last position you will remove that
charachter

- if you put also the if in the method it&#039;s more cleaner, for example as private methods (i&#039;m not good with lamba expression :( )

CheckAppendUpdateString(
                        StringBuilder updateString,
                        string previousField,
                        string currentField,
                        string fieldName)
{
if (previous != current)
{
updateString.Append( fieldName + &quot; = ‘” + current + “’” );
}
if (updateString.Length &gt; 0)
{
updateString.Append(“,”);
}

}</description>
		<content:encoded><![CDATA[<p>2 little suggestion:<br />
- StringBuilder is mutable so you can add ever the comma and then check if the string builder have a comma at the last position you will remove that<br />
charachter</p>
<p>- if you put also the if in the method it&#8217;s more cleaner, for example as private methods (i&#8217;m not good with lamba expression <img src='http://www.developingfor.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  )</p>
<p>CheckAppendUpdateString(<br />
                        StringBuilder updateString,<br />
                        string previousField,<br />
                        string currentField,<br />
                        string fieldName)<br />
{<br />
if (previous != current)<br />
{<br />
updateString.Append( fieldName + &#8221; = ‘” + current + “’” );<br />
}<br />
if (updateString.Length &gt; 0)<br />
{<br />
updateString.Append(“,”);<br />
}</p>
<p>}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
