CSharpFeeds - All your C# feeds in one place.

Sponsors

Sunday, May 13, 2007

Extension methods missing from System.String in the .NET Framework 3.5 (Beta 1)

by Paulo Morgado via Paulo Morgado : C# on 5/13/2007 6:41:09 PM

UPDATE: Extension methods

Extension methods are a feature of the new C# language specification (also available in Visual Basic [^] [^]):

This new feature should be used in existing classes like the String class by making the folowing methods extension methods:

public static int Compare(this string strA, string strB);

public static int Compare(this string strA, string strB, bool ignoreCase);

public static int Compare(this string strA, string strB, System.StringComparison comparisonType);

public static int Compare(this string strA, string strB, bool ignoreCase, System.Globalization.CultureInfo culture);

public static int Compare(this string strA, int indexA, string strB, int indexB, int length);

public static int Compare(this string strA, int indexA, string strB, int indexB, int length, bool ignoreCase);

public static int Compare(this string strA, int indexA, string strB, int indexB, int length, System.StringComparison comparisonType);

public static int Compare(this string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, System.Globalization.CultureInfo culture);

public static int CompareOrdinal(this string strA, string strB);

public static int CompareOrdinal(this string strA, int indexA, string strB, int indexB, int length);

public static string Concat(this string str0, string str1);

public static string Concat(this string str0, string str1, string str2);

public static string Concat(this string str0, string str1, string str2, string str3);

public static string Copy(this string str);

public static string Intern(this string str);

public static string IsInterned(this string str);

public static bool IsNullOrEmpty(this string value);

This would allow us to write code like this:

if (someString.IsNullOrEmpty())

{

    //...

}

If you would like to see this in the next release of the .NET framework, vote on this suggestion.

email it!bookmark it!digg it!

Original Post: Extension methods missing from System.String in the .NET Framework 3.5 (Beta 1)

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us