MMLib.Extensions.StringExtensions

This static class contains helpful extensions for string.
Nowadays contains following static methods:

Name Description
RemoveDiacritics(System.String) Remove diacritics from string. Origin value can be null and String.Empty.
Truncate(System.String,System.Int32) Truncate string to max lenght. Origin value can by null and String.Empty.
RemoveChars(System.String,System.String) Remove unexpected chars from string.
SplitBySeparator(System.String,System.String) Split string by string separator.
SplitBySeparator(System.String,System.String,System.Boolean) Split string by string separator.
SafeTrimStart(System.String) Removes all leading occurrences of a set of characters specified in an array from the current System.String object.If value is null then return null.
SafeLength(System.String) Gets the number of characters in the current System.String object.If value is null then return 0.
SafeSubstring(System.String,System.Int32) Retrieves a substring from this instance. The substring starts at a specifiedcharacter position and has a specified length.If value is null or empty then return origin text.
IsNumber(System.String) Check, if string value is number.
IsNullOrEmpty(System.String) Indicates whether the specified string is null or an System.String.Emptystring.
IsNullOrWhiteSpace(System.String) Indicates whether a specified string is null, empty, or consists only ofwhite-space characters.
FormatAsPattern(System.String,System.Object) Replaces one or more format items in a specified string with the string representationof a specified object.
FormatAsPattern(System.String,System.Object[]) Replaces one or more format items in a specified string with the string representationof a corresponding object in a specified array.
JoinToString(System.Object[],System.String) Join values to one string with separator.
JoinToString(System.Collections.Generic.List{System.String},System.String) Join values to one string with separator.
DefaultIfNull(System.String) Check value is null and then return value or string.Empty.
DefaultIfNull(System.String,System.String) Check value is null and then return value or defValue.
IsValidEmailAddress(System.String) Check if specific email address is valid.
IsValidIPAddress(System.String) Check if specific IP address is valid.
IsValidUrlAddress(System.String) Check if specific URL address is valid.
HtmlDecode(System.String) Decode html text to plain text. (Replace Html entities like copy; to ©).

Last edited May 4, 2014 at 3:50 PM by MinoMartiniak, version 5