Room for reference
September 02, 2005
  New Recommendations for Using Strings in Microsoft .NET 2.0 There is an article on MSDN, "New Recommendations for Using Strings in Microsoft .NET 2.0", that explains the motivation behind Ordinal comparison and the new members of the System.StringComparison enumeration in .NET 2.0. I admittedly glazed over, reading it the first time, but the third example in the section "The Motivation: The Turkish-I Problem" makes a world of sense... comparing InvariantCulture does not do a bit-wise comparison of the strings.

So, if you are comparing System.Uri's, do you compare using InvariantCulture (since the URI should be ASCII), or should you use Ordinal (given the guidance in "Choosing a StringComparison Member for Your Method Call" to use Ordinal for XML and HTTP)? The guidance from the owner of System.Uri indicated to just use Uri.Compare(). The prototype for Uri.Compare looks like:

public static int Compare(
Uriuri1,
Uriuri2,
UriComponentspartsToCompare,
UriFormatcompareFormat,
StringComparisoncomparisonType
);

 
Comments:
I do believe all of the concepts you’ve introduced in your post. They’re very convincing and will definitely work. Nonetheless, the posts are too short for novices. May you please extend them a bit from subsequent time? Thank you for the post.
Office Interiors in Chennai
Interior Decorators in Chennai

 
Post a Comment

<< Home
a blog on Technology of Microsoft & much more..

My Photo
Name:
Location: Chennai, Tamil Nadu, India
ARCHIVES
May 2004 / June 2004 / July 2004 / August 2004 / September 2004 / October 2004 / September 2005 /


Powered by Blogger