StringExtensions
Useful methods for string objects.
Collapses all spaces in the given string.
Collapses and strips all spaces in the given string.
Examines if a the given list of characters contains a certain element.
Returns a value indicating whether the specified object occurs within this string.
This method might seem obsolete, but it is quite useful in case of porting
AngleSharp to a PCL, where String instances to not have a Contains method.
Examines if a the given list of string contains a certain element.
Serializes the string to a CSS color.
Serializes the string to a CSS string.
Serializes the string to a CSS url.
Converts the given string to an integer.
Converts the given string to an integer.
Retrieves a string describing the compatibility mode of the given quirksmode.
Checks if the provided string starts with the given value, either by exactly matching it,
or by comparing against the start including an additional dash character.
Replaces characters in names and values that cannot be expressed by using the given
encoding with &#...; base-10 unicode point.
Determines if the given string consists only of digits (0-9) as specified here:
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#ascii-digits
Determines if the given string only contains characters, which are hexadecimal (0-9a-fA-F) as specified here:
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#ascii-hex-digits
Examines if the given element is equal to one of the given elements.
Examines if the given element is equal to one of the given elements.
public static bool IsOneOf(this string element, string item1, string item2, string item3, string item4)
Examines if the given element is equal to one of the given elements.
public static bool IsOneOf(this string element, string item1, string item2, string item3, string item4, string item5)
Examines if the given element is equal to one of the given elements.
public static bool IsOneOf(this string element, string item1, string item2, string item3, string item4, string item5, string item6)
Examines if the given element is equal to one of the given elements.
public static bool IsOneOf(this string element, string item1, string item2, string item3, string item4, string item5, string item6, string item7)
Examines if the given element is equal to one of the given elements.
Parses a string that represents an image candidate.
public static IEnumerable<Tuple<Url, Predicate<RenderDevice>>> ParseImageCandidates(this string value)
Parses a list of image candidates, separated by commas.
Converts the given value to a sandbox flag.
Replaces the first occurance of the string search with replace.
Splits the string on commas.
Splits the string on space characters.
Splits the string with the given char delimiter.
Splits the char array with the given char delimiter.
Splits the string with the given char delimiter and trims the leading and tailing spaces.
Strips all leading and tailing space characters from the given string.
Strips all leading and tailing space characters from the given char array.
Strips all line breaks from the given string.
Converts the given value to a boolean (or not).
Converts the given value to a double (or not).
Converts the given value to an enumeration value (or not).
Converts the given value to an integer (or not).
Converts the given value to an unsigned integer (or not).
Replaces characters in names and values that should not be in URL values.
Replaces the bytes 0x20 (U+0020 SPACE if interpreted as ASCII) with a single 0x2B byte ("+" (U+002B)
character if interpreted as ASCII).
If a byte is not in the range 0x2A, 0x2D, 0x2E, 0x30 to 0x39, 0x41 to 0x5A, 0x5F, 0x61 to 0x7A, it is
replaced with its hexadecimal value (zero-padded if necessary), starting with the percent sign.