<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx</link><description>System.String contains the static methods ‘Compare’ and ‘Equals’ which are used for string comparison. public static int Compare( string strA, string strB) public static bool Equals( string a, string b) These two methods perform two very different kinds</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3017300</link><pubDate>Fri, 01 Jun 2007 06:15:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3017300</guid><dc:creator>Kent Boogaart</dc:creator><description>&lt;p&gt;Hello. Surely the confusion is over the default behavior of Equals vs Compare. Both methods provide overloads that take a StringComparison, so both can do ordinal or cultural comparisons.&lt;/p&gt;
&lt;p&gt;The real difference is that Compare will tell you whether one string is less than or greater than another, whereas Equals will only tell you whether they are equal.&lt;/p&gt;
&lt;p&gt;Oh, and the default behavior of == is the same as Equals, right?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>Something .NET does less intuitively than they ought</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3019660</link><pubDate>Fri, 01 Jun 2007 09:59:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3019660</guid><dc:creator>Sorting It All Out</dc:creator><description>&lt;p&gt;If you are someone who reads the BCL Team blog, you may have seen Josh Free's String.Compare() != String.Equals()&lt;/p&gt;
</description></item><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3025971</link><pubDate>Fri, 01 Jun 2007 18:03:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3025971</guid><dc:creator>Josh Free</dc:creator><description>&lt;p&gt;Hi Kent,&lt;/p&gt;
&lt;p&gt;Yes, == is the same as the default Equals overload (Ordinal).&lt;/p&gt;
</description></item><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3027075</link><pubDate>Fri, 01 Jun 2007 19:26:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3027075</guid><dc:creator>Dave Quick</dc:creator><description>&lt;p&gt;This is a nice, clear explanation. You should have the user education folks copy at least a little of this into the method summary on the VS documentation page for the String.Compare Method topic. It currently reads &amp;quot;Compares two specified String objects.&amp;quot;, which is perfectly correct, but not terribly helpful. Sort of like that old MSFT joke about the guy in the helicopter. That topic could also use a See Also link to the &amp;quot;Performing Culture-Insensitive String Comparisons&amp;quot; and &amp;quot;String.Equals Method&amp;quot; topics.&lt;/p&gt;
</description></item><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3100028</link><pubDate>Tue, 05 Jun 2007 19:31:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3100028</guid><dc:creator>James Curran</dc:creator><description>&lt;p&gt;Of course, to confuse matters even more, String.Equals returns a boolean, while String.Compare returns an int.&lt;/p&gt;
&lt;p&gt;And, if you cast the return from String.Compare to a boolean, it will be the exact OPPOSITE of calling String.Equals with the same paramters.&lt;/p&gt;
</description></item><item><title>.NET Tips &amp; Tricks </title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3272949</link><pubDate>Wed, 13 Jun 2007 22:08:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3272949</guid><dc:creator>Michael's Coding Den</dc:creator><description>&lt;p&gt;Last update: June 13 , 2007 Document version 0.6 Preface If you have something to add, or want to take&lt;/p&gt;
</description></item><item><title>.NET Tips &amp; Tricks: Common</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3273429</link><pubDate>Wed, 13 Jun 2007 22:56:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3273429</guid><dc:creator>Michael's Coding Den</dc:creator><description>&lt;p&gt;Common INFO: &amp;#183; const is &amp;amp;quot;baked&amp;amp;quot; into the assembly. If you have to change the const value in&lt;/p&gt;
</description></item><item><title>.NET Tips &amp; Tricks: Common</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3273764</link><pubDate>Wed, 13 Jun 2007 23:14:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3273764</guid><dc:creator>Michael's Coding Den</dc:creator><description>&lt;p&gt;This section describes the common .NET tips which don&amp;amp;#39;t relates to the specific category. INFO:&lt;/p&gt;
</description></item><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3425374</link><pubDate>Wed, 20 Jun 2007 17:35:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3425374</guid><dc:creator>Chris J. Breisch</dc:creator><description>&lt;p&gt;Thanks. &amp;nbsp;But what about ==? &amp;nbsp;Does that call .Equals()? .Compare()? &amp;nbsp;Something else?&lt;/p&gt;
</description></item><item><title>re: String.Compare() != String.Equals() [Josh Free]</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3426078</link><pubDate>Wed, 20 Jun 2007 18:23:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3426078</guid><dc:creator>Inbar Gazit</dc:creator><description>&lt;p&gt;== is just like String.Equals as you can see in here: &lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/system.string.op_equality.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.string.op_equality.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>String.Equals Performance Comparison</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#3605537</link><pubDate>Fri, 29 Jun 2007 18:54:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3605537</guid><dc:creator>Noah Coad</dc:creator><description>&lt;p&gt;I recently had an app that I used the VSTS Profiler on to find that a significant portion of time was&lt;/p&gt;
</description></item><item><title>String.StartsWith || String.EndsWith != String.Equals, either</title><link>http://blogs.msdn.com/bclteam/archive/2007/05/31/string-compare-string-equals-josh-free.aspx#8528562</link><pubDate>Wed, 21 May 2008 19:08:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8528562</guid><dc:creator>Sorting it all Out</dc:creator><description>&lt;p&gt;Research Developer Mahmoud's question was quite reasonable on its face: Hi All, I was having a problem,&lt;/p&gt;
</description></item></channel></rss>