🚀Speed up implementation with hands-on, face-to-face training from the developer.

Tokens

Jube relies on the injection of VB .Net code which is subsequently complied by reflection in the .net core runtime. While this allows for extremely fast rules to be created it does expose security issues in the possibility of code injection. This code injection could be sinister given the breadth of the .net API (although the Jube instance should be run with the least privileges, not needing to perform any disk IO or operating system level interaction beyond logging, and even logging can be offloaded via syslog).

To ensure that malicious code cannot be been injected, an integrity check on the all code created by the user is performed before compile on creation and in the background during model synchronisation. In the event that the code does not pass an integrity check, it would be bypassed, with ERROR level being written to the logs.

All tokens inside a rule must be registered in the RuleScriptToken table in the database:

select *
from "RuleScriptToken"

There are some default tokens which are embedded into the parser already, but they support only the most basis logic statements and object names from model invocation. The following tokens are hard coded:

{“Return”,”If”,”Then”,”End If”,”False”,”True”,”Payload”,”Abstraction”,”Activation”,”Select”,”Case”,”End Select”,” Contains”,”Sanction”,”KVP”,”List”,”TTLCounter”,”String”,”Double”,”Integer”,”DateTime”,”CType”,”Boolean”,”Data”,” Calculation”,”Not”}

The parse function takes a string containing a VB .Net code fragment and performs several steps to parse for integrity. For the purposes of this example, the following rule will be parsed for integrity:

If Payload.Name = "Richard" Then
  Matched = True
End If

The first step of the parse is to break the rule into its component lines on CrLf, Cr or Lf. Each line will be parsed one by one.

For the line, enclosed strings will be removed as they are allowed to contain a multitude of data. In this example, “ Richard” is an enclosed string. The soft parser will now see the line as follows:

If Data() = Then

The soft parse breaks the line into tokens, to check that the tokens exist in the registry. The line is split based upon the following array of allowed characters:

{“,”, “ “, “(“, “)”, “=”, “>”, “<”, “>=”, “<=”, “<>”, “.”, “_”,”+”,”-“,”/”,”*”,”&”}

The soft parser will now see an array as follows:

{“If”,”Payload”,”Then”,”End”,”If”}

Each token will be checked for integrity. Firstly, the token will be tested to see if it is numeric, and if so, no further integrity checking on that token will take place. Assuming that the token is not numeric, it will be validated against the list of allowed tokens. The base assumption is that the rule string is not valid and all tokens must be found in order for the line to be considered as being valid.

There is a curious case of valid language tokens such a “End If” which is logically a single token, but would be read as two tokens. As seen above, it is possible to store such logical tokens in the registry.

For each token stored in the database or hardcoded, a test token will be taken and a match will be sought (i.e. looking one by one, for each token) against the registry of tokens. If a match is found, the integrity of that token will be declared valid, and it will move onto the next token.

Any token that does not find a corresponding match or entry in the registry will be declared invalid, which is enough for the entire integrity of the rule text to be declared invalid, although the routine will continue to run, reporting out all problematic tokens to the error logs.

To deal with the unusual case where a token in the registry is separated by a space, depending on the number of spaces in the token registry entry, the test token will be reconstructed for that same number of subsequent tokens awaiting test (for example End, which is not allowed, is reconstructed to End If). This is because to allow End could allow the fatal termination of the application to be injected, yet End If is innocent.

If for any reason any token parse fails, the parse would will return false, which will in most areas of the system cause that code not to be complied in reflection. If for any reason rules are not working a expected, it is suggested to check the logs to look for any soft parse failures at ERROR level, as this can be a common cause of rules not working as desired.

The premise of the Jube is that it is comprised of hundreds, if not thousands of rules, which are intended to match upon data processed in real-time. One of the reasons that the Jube is so fast in processing, despite the number of rules required of processing, is that when a rule is created, it is compiled to native code and as such runs about as fast as any low level .net programming function.

Compiling code dynamically is extraordinarily expensive and it is thunderously slow, hence cannot be relied upon in a real-time process. A process has been developed to perform compilation in the background while ensuring it can be referenced real-time as if it were - almost - a native function of the .Net platform, hence extraordinarily fast.

The Jube uses .Net reflection and the language is VB.net (as this is more intuitive than C#, although Jube is written in C#). The process of compilation is as follows:

  • For every rule, a class is created that makes references to several third party DLL’s and;
  • For the newly written class code, a function of sub routines is created and;
  • The rules are invariably very small fragments that are intended to sit inside the newly created subroutine, as such the code is embedded.
  • A check is made to see if the class code already exists, in a compiled state, in the compiled hash cache. This step ensures that there is no duplication in rules in the applications memory as if it already exists in a compiled state, it will simply be referenced rather than recompiled.
  • In the absence of class code already existing in memory, it will be compiled to an assembly and;
  • A delegate will be attached such that it provides recall performance not dissimilar to that of a native .Net function.
  • Upon successful compilation, the assembly will be added to the compiled hash cache.

One of the legacy weaknesses of the .Net core when dealing with compiled code is that while assemblies can be compiled and loaded dynamically, they cannot be unloaded. It follows that a compiled assembly, even if not being used, will exist in the applications memory until the next restart. The compiled rules take up a negligible amount of space in memory, but it is worth bearing in mind as a explanation for shallow memory leak over a long period of time. In order to reduce the impact of this memory leak, a compiled hash cache is used to ensure that an assembly is only ever created the once in the lifetime of the application:

  • When code is created dynamically, as described above, that code is hashed using MD5 to create a digest.
  • This digest is the key to the assembly cache and upon successful compilation of the code into an assembly, that assembly is stored as the value of a dictionary entry.
  • In all cases of dynamic compilation the compiled hash case will be referenced to see if the assembly already exists such to avoid expensive recompilation and memory leak.

Henceforth, in the use of the Assembly Cache, where rule criteria is often in common, the memory used by assemblies can often be reduced.

The following rules and scripts are subject to the compilation process and are the result of rules being created in the user interface as VB .Net code fragments:

  • Abstraction Rules.
  • Activation Rules.
  • Gateway Rules.
  • Inline Functions.
  • Abstraction Calculations.

The following classes are created as much more advanced, and flexible, complete class stored in the database. The creation of these code fragments are documented separately, although it suffices at this stage to explain that code can be freestyle subject to it conforming to an interface specification.

  • Inline Scripts which exist as an entire class, including Import statements, implementing a specific interface.

Any compilation errors will be written to the logs as ERROR level, detailing the compiler errors.

Extensions

Extension methods enhance rule flexibility via a fluent syntax. For example, consider the expression:

If(Payload("StringValue").Contains("Value")) Then
    Return Matched
End If

Here, Contains("Value") is an extension method with the signature Contains(this string) that returns a Boolean value.

Extension methods are developed in a dedicated assembly, namespace, and type: Jube.Dictionary.Extensions.Extensions.

During rule parsing and token fetching, the soft parser scans this type using reflection. Any identified methods are then added as rule tokens, making them available to use in rules, as they would otherwise be security restricted for use.

As a design principle, any advanced rule functionality in Jube is implemented via extension methods. A wide variety of extension methods are available for each of the data types implemented in Jube, with more added each release based on user feedback and new use cases.

The fluent syntax and the restriction of exposing functionality only via extension methods help maintain platform reliability. Extension methods are subject to some review and performance consideration, chiefly to ensure reliable realtime performance, noting that Do, While and For Looping is otherwise unavailable.

The following extension methods are available:

Method Signature Description Parameters
Boolean Extensions    
IfFalse(this bool @this, Action action) Executes an Action if the boolean value is false. @this: The boolean to act on.
action: The action to execute.
IfTrue(this bool @this, Action action) Executes an Action if the boolean value is true. @this: The boolean to act on.
action: The action to execute.
ToBinary(this bool @this) Converts the boolean to a binary representation. @this: The boolean to act on.
ToString(this bool @this, string trueValue, string falseValue) Returns a custom string based on the boolean value. @this: The boolean to act on.
trueValue: The value to return if true.
falseValue: The value to return if false.
Char Extensions    
ConvertToUtf32(this char highSurrogate, char lowSurrogate) Converts a UTF-16 surrogate pair into a Unicode code point. highSurrogate: A high surrogate code unit (U+D800 through U+DBFF).
lowSurrogate: A low surrogate code unit (U+DC00 through U+DFFF).
GetNumericValue(this char c) Gets the numeric value of a Unicode character. c: The Unicode character to convert.
GetUnicodeCategory(this char c) Gets the Unicode category of a character. c: The Unicode character to categorize.
In(this char @this, params char[] values) Checks if the character is equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
IsControl(this char c) Checks if the character is a control character. c: The Unicode character to evaluate.
IsDigit(this char c) Checks if the character is a decimal digit. c: The Unicode character to evaluate.
IsHighSurrogate(this char c) Checks if the character is a high surrogate. c: The Unicode character to evaluate.
IsLetter(this char c) Checks if the character is a Unicode letter. c: The Unicode character to evaluate.
IsLetterOrDigit(this char c) Checks if the character is a letter or decimal digit. c: The Unicode character to evaluate.
IsLower(this char c) Checks if the character is a lowercase letter. c: The Unicode character to evaluate.
IsLowSurrogate(this char c) Checks if the character is a low surrogate. c: The character to evaluate.
IsNumber(this char c) Checks if the character is a number. c: The Unicode character to evaluate.
IsPunctuation(this char c) Checks if the character is a punctuation mark. c: The Unicode character to evaluate.
IsSeparator(this char c) Checks if the character is a separator character. c: The Unicode character to evaluate.
IsSurrogate(this char c) Checks if the character is a surrogate. c: The Unicode character to evaluate.
IsSurrogatePair(this char highSurrogate, char lowSurrogate) Checks if two characters form a surrogate pair. highSurrogate: The character to evaluate as high surrogate.
lowSurrogate: The character to evaluate as low surrogate.
IsSymbol(this char c) Checks if the character is a symbol character. c: The Unicode character to evaluate.
IsUpper(this char c) Checks if the character is an uppercase letter. c: The Unicode character to evaluate.
IsWhiteSpace(this char c) Checks if the character is whitespace. c: The Unicode character to evaluate.
NotIn(this char @this, params char[] values) Checks if the character is not equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
Repeat(this char @this, int repeatCount) Repeats the character a specified number of times. @this: The char to act on.
repeatCount: Number of repeats.
To(this char @this, char toCharacter) Enumerates from the current character to the specified character. @this: The char to act on.
toCharacter: The target character.
ToLower(this char c, CultureInfo culture) Converts the character to lowercase using specified culture rules. c: The Unicode character to convert.
culture: An object that supplies culture-specific casing rules.
ToLower(this char c) Converts the character to lowercase. c: The Unicode character to convert.
ToLowerInvariant(this char c) Converts the character to lowercase using invariant culture rules. c: The Unicode character to convert.
ToString(this char c) Converts the character to its string representation. c: The Unicode character to convert.
ToUpper(this char c, CultureInfo culture) Converts the character to uppercase using specified culture rules. c: The Unicode character to convert.
culture: An object that supplies culture-specific casing rules.
ToUpper(this char c) Converts the character to uppercase. c: The Unicode character to convert.
ToUpperInvariant(this char c) Converts the character to uppercase using invariant culture rules. c: The Unicode character to convert.
DateTime Extensions    
Age(this DateTime @this) Calculates the age from the given date. @this: The DateTime to act on.
Between(this DateTime @this, DateTime minValue, DateTime maxValue) Checks if the date is between two dates (exclusive). @this: The DateTime to act on.
minValue: The minimum value.
maxValue: The maximum value.
ConvertTime(this DateTime dateTime, TimeZoneInfo destinationTimeZone) Converts the time to a different time zone. dateTime: The date and time to convert.
destinationTimeZone: The time zone to convert to.
ConvertTime(this DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone) Converts the time from one time zone to another. dateTime: The date and time to convert.
sourceTimeZone: The time zone of the dateTime.
destinationTimeZone: The time zone to convert to.
ConvertTimeBySystemTimeZoneId(this DateTime dateTime, string destinationTimeZoneId) Converts the time using time zone identifiers. dateTime: The date and time to convert.
destinationTimeZoneId: The identifier of the destination time zone.
ConvertTimeBySystemTimeZoneId(this DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId) Converts the time between time zones using identifiers. dateTime: The date and time to convert.
sourceTimeZoneId: The identifier of the source time zone.
destinationTimeZoneId: The identifier of the destination time zone.
ConvertTimeFromUtc(this DateTime dateTime, TimeZoneInfo destinationTimeZone) Converts UTC time to a specified time zone. dateTime: The Coordinated Universal Time (UTC).
destinationTimeZone: The time zone to convert to.
ConvertTimeToUtc(this DateTime dateTime) Converts the time to UTC. dateTime: The date and time to convert.
ConvertTimeToUtc(this DateTime dateTime, TimeZoneInfo sourceTimeZone) Converts the time from a specified time zone to UTC. dateTime: The date and time to convert.
sourceTimeZone: The time zone of the dateTime.
Elapsed(this DateTime datetime) Returns the time elapsed since the given date. datetime: The datetime to act on.
EndOfDay(this DateTime @this) Returns the end of the day (23:59:59.999). @this: The DateTime to act on.
EndOfMonth(this DateTime @this) Returns the end of the month. @this: The DateTime to act on.
EndOfWeek(this DateTime dt, DayOfWeek startDayOfWeek = DayOfWeek.Sunday) Returns the end of the week. dt: The DateTime to act on.
startDayOfWeek: The start day of week (optional).
EndOfYear(this DateTime @this) Returns the end of the year. @this: The DateTime to act on.
FirstDayOfWeek(this DateTime @this) Returns the first day of the week. @this: The DateTime to act on.
In(this DateTime @this, params DateTime[] values) Checks if the date is equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
InRange(this DateTime @this, DateTime minValue, DateTime maxValue) Checks if the date is between two dates (inclusive). @this: The DateTime to act on.
minValue: The minimum value.
maxValue: The maximum value.
IsAfternoon(this DateTime @this) Checks if the time is in the afternoon. @this: The DateTime to act on.
IsDateEqual(this DateTime date, DateTime dateToCompare) Checks if two dates have the same date part. date: The date to act on.
dateToCompare: The date to compare.
IsDaylightSavingTime(this DateTime time, DaylightTime daylightTimes) Checks if the date is within a daylight saving time period. time: A date and time.
daylightTimes: A daylight saving time period.
IsFuture(this DateTime @this) Checks if the date is in the future. @this: The DateTime to act on.
IsMorning(this DateTime @this) Checks if the time is in the morning. @this: The DateTime to act on.
IsNow(this DateTime @this) Checks if the date is the current moment. @this: The DateTime to act on.
IsPast(this DateTime @this) Checks if the date is in the past. @this: The DateTime to act on.
IsTimeEqual(this DateTime time, DateTime timeToCompare) Checks if two dates have the same time part. time: The time to act on.
timeToCompare: The time to compare.
IsToday(this DateTime @this) Checks if the date is today. @this: The DateTime to act on.
IsWeekDay(this DateTime @this) Checks if the date is a weekday. @this: The DateTime to act on.
IsWeekendDay(this DateTime @this) Checks if the date is a weekend day. @this: The DateTime to act on.
LastDayOfWeek(this DateTime @this) Returns the last day of the week. @this: The DateTime to act on.
NotIn(this DateTime @this, params DateTime[] values) Checks if the date is not equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
SetTime(this DateTime current, int hour) Sets the time of the date (hour only). current: The current date.
hour: The hour.
SetTime(this DateTime current, int hour, int minute) Sets the time of the date (hour and minute). current: The current date.
hour: The hour.
minute: The minute.
SetTime(this DateTime current, int hour, int minute, int second) Sets the time of the date (hour, minute, second). current: The current date.
hour: The hour.
minute: The minute.
second: The second.
SetTime(this DateTime current, int hour, int minute, int second, int millisecond) Sets the time of the date (hour, minute, second, millisecond). current: The current date.
hour: The hour.
minute: The minute.
second: The second.
millisecond: The millisecond.
StartOfDay(this DateTime @this) Returns the start of the day (00:00:00.000). @this: The DateTime to act on.
StartOfMonth(this DateTime @this) Returns the start of the month. @this: The DateTime to act on.
StartOfWeek(this DateTime dt, DayOfWeek startDayOfWeek = DayOfWeek.Sunday) Returns the start of the week. dt: The DateTime to act on.
startDayOfWeek: The start day of week (optional).
StartOfYear(this DateTime @this) Returns the start of the year. @this: The DateTime to act on.
ToEpochTimeSpan(this DateTime @this) Converts the date to an epoch time span. @this: The DateTime to act on.
ToFullDateTimeString(this DateTime @this) Converts the date to a full date time string. @this: The DateTime to act on.
ToFullDateTimeString(this DateTime @this, string culture) Converts the date to a full date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToFullDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a full date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateShortTimeString(this DateTime @this) Converts the date to a long date and short time string. @this: The DateTime to act on.
ToLongDateShortTimeString(this DateTime @this, string culture) Converts the date to a long date and short time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateShortTimeString(this DateTime @this, CultureInfo culture) Converts the date to a long date and short time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateString(this DateTime @this) Converts the date to a long date string. @this: The DateTime to act on.
ToLongDateString(this DateTime @this, string culture) Converts the date to a long date string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateString(this DateTime @this, CultureInfo culture) Converts the date to a long date string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateTimeString(this DateTime @this) Converts the date to a long date time string. @this: The DateTime to act on.
ToLongDateTimeString(this DateTime @this, string culture) Converts the date to a long date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a long date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongTimeString(this DateTime @this) Converts the date to a long time string. @this: The DateTime to act on.
ToLongTimeString(this DateTime @this, string culture) Converts the date to a long time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToLongTimeString(this DateTime @this, CultureInfo culture) Converts the date to a long time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToMonthDayString(this DateTime @this) Converts the date to a month and day string. @this: The DateTime to act on.
ToMonthDayString(this DateTime @this, string culture) Converts the date to a month and day string using a culture. @this: The DateTime to act on.
culture: The culture.
ToMonthDayString(this DateTime @this, CultureInfo culture) Converts the date to a month and day string using a culture. @this: The DateTime to act on.
culture: The culture.
Tomorrow(this DateTime @this) Returns the next day at the same time. @this: The DateTime to act on.
ToRFC1123String(this DateTime @this) Converts the date to an RFC1123 string. @this: The DateTime to act on.
ToRFC1123String(this DateTime @this, string culture) Converts the date to an RFC1123 string using a culture. @this: The DateTime to act on.
culture: The culture.
ToRFC1123String(this DateTime @this, CultureInfo culture) Converts the date to an RFC1123 string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateLongTimeString(this DateTime @this) Converts the date to a short date and long time string. @this: The DateTime to act on.
ToShortDateLongTimeString(this DateTime @this, string culture) Converts the date to a short date and long time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateLongTimeString(this DateTime @this, CultureInfo culture) Converts the date to a short date and long time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateString(this DateTime @this) Converts the date to a short date string. @this: The DateTime to act on.
ToShortDateString(this DateTime @this, string culture) Converts the date to a short date string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateString(this DateTime @this, CultureInfo culture) Converts the date to a short date string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateTimeString(this DateTime @this) Converts the date to a short date time string. @this: The DateTime to act on.
ToShortDateTimeString(this DateTime @this, string culture) Converts the date to a short date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a short date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortTimeString(this DateTime @this) Converts the date to a short time string. @this: The DateTime to act on.
ToShortTimeString(this DateTime @this, string culture) Converts the date to a short time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToShortTimeString(this DateTime @this, CultureInfo culture) Converts the date to a short time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToSortableDateTimeString(this DateTime @this) Converts the date to a sortable date time string. @this: The DateTime to act on.
ToSortableDateTimeString(this DateTime @this, string culture) Converts the date to a sortable date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToSortableDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a sortable date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToUniversalSortableDateTimeString(this DateTime @this) Converts the date to a universal sortable date time string. @this: The DateTime to act on.
ToUniversalSortableDateTimeString(this DateTime @this, string culture) Converts the date to a universal sortable date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToUniversalSortableDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a universal sortable date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToUniversalSortableLongDateTimeString(this DateTime @this) Converts the date to a universal sortable long date time string. @this: The DateTime to act on.
ToUniversalSortableLongDateTimeString(this DateTime @this, string culture) Converts the date to a universal sortable long date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToUniversalSortableLongDateTimeString(this DateTime @this, CultureInfo culture) Converts the date to a universal sortable long date time string using a culture. @this: The DateTime to act on.
culture: The culture.
ToYearMonthString(this DateTime @this) Converts the date to a year and month string. @this: The DateTime to act on.
ToYearMonthString(this DateTime @this, string culture) Converts the date to a year and month string using a culture. @this: The DateTime to act on.
culture: The culture.
ToYearMonthString(this DateTime @this, CultureInfo culture) Converts the date to a year and month string using a culture. @this: The DateTime to act on.
culture: The culture.
Yesterday(this DateTime @this) Returns the previous day at the same time. @this: The DateTime to act on.
Double Extensions    
Abs(this double value) Returns the absolute value. value: A number that is greater than or equal to Double.MinValue, but less than or equal to Double.MaxValue.
Acos(this double d) Returns the angle whose cosine is the specified number. d: A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1.
Asin(this double d) Returns the angle whose sine is the specified number. d: A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1.
Atan(this double d) Returns the angle whose tangent is the specified number. d: A number representing a tangent.
Atan2(this double y, double x) Returns the angle whose tangent is the quotient of two numbers. y: The y coordinate of a point.
x: The x coordinate of a point.
Between(this double @this, double minValue, double maxValue) Checks if the value is between two values (exclusive). @this: The double to act on.
minValue: The minimum value.
maxValue: The maximum value.
Ceiling(this double a) Returns the smallest integral value greater than or equal to the number. a: A double-precision floating-point number.
Cos(this double d) Returns the cosine of the specified angle. d: An angle, measured in radians.
Cosh(this double value) Returns the hyperbolic cosine of the specified angle. value: An angle, measured in radians.
Exp(this double d) Returns e raised to the specified power. d: A number specifying a power.
Floor(this double d) Returns the largest integer less than or equal to the number. d: A double-precision floating-point number.
FromDays(this double value) Returns a TimeSpan representing the number of days. value: A number of days, accurate to the nearest millisecond.
FromHours(this double value) Returns a TimeSpan representing the number of hours. value: A number of hours accurate to the nearest millisecond.
FromMilliseconds(this double value) Returns a TimeSpan representing the number of milliseconds. value: A number of milliseconds.
FromMinutes(this double value) Returns a TimeSpan representing the number of minutes. value: A number of minutes, accurate to the nearest millisecond.
FromOADate(this double d) Converts an OLE Automation date to a DateTime. d: An OLE Automation Date value.
FromSeconds(this double value) Returns a TimeSpan representing the number of seconds. value: A number of seconds, accurate to the nearest millisecond.
IEEERemainder(this double x, double y) Returns the remainder from division. x: A dividend.
y: A divisor.
In(this double @this, params double[] values) Checks if the value is equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
InRange(this double @this, double minValue, double maxValue) Checks if the value is between two values (inclusive). @this: The double to act on.
minValue: The minimum value.
maxValue: The maximum value.
IsInfinity(this double d) Checks if the value is infinity. d: A double-precision floating-point number.
IsNaN(this double d) Checks if the value is not a number. d: A double-precision floating-point number.
IsNegativeInfinity(this double d) Checks if the value is negative infinity. d: A double-precision floating-point number.
IsPositiveInfinity(this double d) Checks if the value is positive infinity. d: A double-precision floating-point number.
Log(this double d) Returns the natural logarithm. d: The number whose logarithm is to be found.
Log(this double d, double newBase) Returns the logarithm in a specified base. d: The number whose logarithm is to be found.
newBase: The base of the logarithm.
Log10(this double d) Returns the base 10 logarithm. d: A number whose logarithm is to be found.
Max(this double val1, double val2) Returns the larger of two numbers. val1: The first of two double-precision floating-point numbers to compare.
val2: The second of two double-precision floating-point numbers to compare.
Min(this double val1, double val2) Returns the smaller of two numbers. val1: The first of two double-precision floating-point numbers to compare.
val2: The second of two double-precision floating-point numbers to compare.
NotIn(this double @this, params double[] values) Checks if the value is not equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
Pow(this double x, double y) Returns a number raised to a specified power. x: A double-precision floating-point number to be raised to a power.
y: A double-precision floating-point number that specifies a power.
Round(this double a) Rounds to the nearest integral value. a: A double-precision floating-point number to be rounded.
Round(this double a, int digits) Rounds to a specified number of fractional digits. a: A double-precision floating-point number to be rounded.
digits: The number of fractional digits in the return value.
Round(this double a, MidpointRounding mode) Rounds using specified rounding rules. a: A double-precision floating-point number to be rounded.
mode: Specification for how to round if it is midway between two other numbers.
Round(this double a, int digits, MidpointRounding mode) Rounds to specified digits using rounding rules. a: A double-precision floating-point number to be rounded.
digits: The number of fractional digits in the return value.
mode: Specification for how to round if it is midway between two other numbers.
Sign(this double value) Returns the sign of the number. value: A signed number.
Sin(this double a) Returns the sine of the specified angle. a: An angle, measured in radians.
Sinh(this double value) Returns the hyperbolic sine of the specified angle. value: An angle, measured in radians.
Sqrt(this double d) Returns the square root. d: The number whose square root is to be found.
Tan(this double a) Returns the tangent of the specified angle. a: An angle, measured in radians.
Tanh(this double value) Returns the hyperbolic tangent of the specified angle. value: An angle, measured in radians.
ToMoney(this double @this) Converts the number to a money format. @this: The double to act on.
Truncate(this double d) Calculates the integral part of the number. d: A number to truncate.
Int32 Extensions    
Abs(this int value) Returns the absolute value. value: A number that is greater than Int32.MinValue, but less than or equal to Int32.MaxValue.
Between(this int @this, int minValue, int maxValue) Checks if the value is between two values (exclusive). @this: The int to act on.
minValue: The minimum value.
maxValue: The maximum value.
BigMul(this int a, int b) Produces the full product of two numbers. a: The first number to multiply.
b: The second number to multiply.
ConvertFromUtf32(this int utf32) Converts a Unicode code point to a UTF-16 string. utf32: A 21-bit Unicode code point.
Days(this int @this) Returns a TimeSpan representing the number of days. @this: The int to act on.
DaysInMonth(this int year, int month) Returns the number of days in the specified month and year. year: The year.
month: The month (a number ranging from 1 to 12).
DivRem(this int a, int b, out int result) Divides and returns the quotient and remainder. a: The dividend.
b: The divisor.
result: The remainder.
FactorOf(this int @this, int factorNumer) Checks if the number is a factor of another. @this: The int to act on.
factorNumer: The number to check against.
FromArgb(this int argb) Creates a Color from a 32-bit ARGB value. argb: A value specifying the 32-bit ARGB value.
FromArgb(this int argb, int red, int green, int blue) Creates a Color from ARGB components. argb: The alpha component.
red: The red component (0-255).
green: The green component (0-255).
blue: The blue component (0-255).
FromArgb(this int argb, Color baseColor) Creates a Color with a new alpha value. argb: The alpha value for the new Color.
baseColor: The Color from which to create the new Color.
FromArgb(this int argb, int green, int blue) Creates a Color from RGB components (alpha implicit). argb: The red component.
green: The green component (0-255).
blue: The blue component (0-255).
FromOle(this int oleColor) Converts an OLE color to a Color. oleColor: The OLE color to translate.
FromWin32(this int win32Color) Converts a Windows color to a Color. win32Color: The Windows color to translate.
GetBytes(this int value) Returns the value as a byte array. value: The number to convert.
HostToNetworkOrder(this int host) Converts from host byte order to network byte order. host: The number to convert, expressed in host byte order.
Hours(this int @this) Returns a TimeSpan representing the number of hours. @this: The int to act on.
In(this int @this, params int[] values) Checks if the value is equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
InRange(this int @this, int minValue, int maxValue) Checks if the value is between two values (inclusive). @this: The int to act on.
minValue: The minimum value.
maxValue: The maximum value.
IsEven(this int @this) Checks if the number is even. @this: The int to act on.
IsLeapYear(this int year) Checks if the year is a leap year. year: A 4-digit year.
IsMultipleOf(this int @this, int factor) Checks if the number is a multiple of another. @this: The int to act on.
factor: The factor to check against.
IsOdd(this int @this) Checks if the number is odd. @this: The int to act on.
IsPrime(this int @this) Checks if the number is prime. @this: The int to act on.
Max(this int val1, int val2) Returns the larger of two numbers. val1: The first of two 32-bit signed integers to compare.
val2: The second of two 32-bit signed integers to compare.
Milliseconds(this int @this) Returns a TimeSpan representing the number of milliseconds. @this: The int to act on.
Min(this int val1, int val2) Returns the smaller of two numbers. val1: The first of two 32-bit signed integers to compare.
val2: The second of two 32-bit signed integers to compare.
Minutes(this int @this) Returns a TimeSpan representing the number of minutes. @this: The int to act on.
NetworkToHostOrder(this int network) Converts from network byte order to host byte order. network: The number to convert, expressed in network byte order.
NotIn(this int @this, params int[] values) Checks if the value is not equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
Seconds(this int @this) Returns a TimeSpan representing the number of seconds. @this: The int to act on.
Sign(this int value) Returns the sign of the number. value: A signed number.
Weeks(this int @this) Returns a TimeSpan representing the number of weeks. @this: The int to act on.
String Extensions    
Br2Nl(this string @this) Converts line breaks to newlines. @this: The string to act on.
CompareOrdinal(this string strA, string strB) Compares two strings using ordinal rules. strA: The first string to compare.
strB: The second string to compare.
CompareOrdinal(this string strA, int indexA, string strB, int indexB, int length) Compares substrings using ordinal rules. strA: The first string to use in the comparison.
indexA: The starting index of the substring in strA.
strB: The second string to use in the comparison.
indexB: The starting index of the substring in strB.
length: The maximum number of characters in the substrings to compare.
Concat(this string str0, string str1) Concatenates two strings. str0: The first string to concatenate.
str1: The second string to concatenate.
Concat(this string str0, string str1, string str2) Concatenates three strings. str0: The first string to concatenate.
str1: The second string to concatenate.
str2: The third string to concatenate.
Concat(this string str0, string str1, string str2, string str3) Concatenates four strings. str0: The first string to concatenate.
str1: The second string to concatenate.
str2: The third string to concatenate.
str3: The fourth string to concatenate.
Concatenate(this IEnumerable<string> @this) Concatenates a collection of strings. @this: The string collection to act on.
Concatenate<T>(this IEnumerable<T> source, Func<T, string> func) Concatenates a collection using a selector function. source: The source collection to act on.
func: The function to extract strings from elements.
ConcatWith(this string @this, params string[] values) Concatenates the string with others. @this: The string to act on.
values: The strings to concatenate with.
Contains(this string @this, string value) Checks if the string contains a substring. @this: The string to act on.
value: The substring to search for.
Contains(this string @this, string value, StringComparison comparisonType) Checks if the string contains a substring with comparison rules. @this: The string to act on.
value: The substring to search for.
comparisonType: The type of comparison to use.
ContainsAll(this string @this, params string[] values) Checks if the string contains all specified substrings. @this: The string to act on.
values: The substrings to search for.
ContainsAll(this string @this, StringComparison comparisonType, params string[] values) Checks if the string contains all substrings with comparison rules. @this: The string to act on.
comparisonType: The type of comparison to use.
values: The substrings to search for.
ContainsAny(this string @this, params string[] values) Checks if the string contains any of the specified substrings. @this: The string to act on.
values: The substrings to search for.
ContainsAny(this string @this, StringComparison comparisonType, params string[] values) Checks if the string contains any substrings with comparison rules. @this: The string to act on.
comparisonType: The type of comparison to use.
values: The substrings to search for.
ConvertToUtf32(this string s, int index) Converts a character or surrogate pair to a Unicode code point. s: A string that contains a character or surrogate pair.
index: The index position of the character or surrogate pair.
DecodeBase64(this string @this) Decodes a Base64 string. @this: The Base64 string to decode.
DeserializeJson<T>(this string json) Deserializes a JSON string to an object. json: The JSON string to deserialize.
DeserializeJson<T>(this string json, Encoding encoding) Deserializes a JSON string using specified encoding. json: The JSON string to deserialize.
encoding: The text encoding to use.
EncodeBase64(this string @this) Encodes a string to Base64. @this: The string to encode.
EqualsIgnoreCase(this string @this, string comparedString) Checks if two strings are equal ignoring case. @this: The string to act on.
comparedString: The string to compare with.
EscapeXml(this string @this) Escapes XML special characters. @this: The string to act on.
Extract(this string @this, Func<char, bool> predicate) Extracts characters based on a predicate. @this: The string to act on.
predicate: The function to determine which characters to extract.
ExtractDecimal(this string @this) Extracts a decimal number from the string. @this: The string to act on.
ExtractDouble(this string @this) Extracts a double from the string. @this: The string to act on.
ExtractInt16(this string @this) Extracts an Int16 from the string. @this: The string to act on.
ExtractInt32(this string @this) Extracts an Int32 from the string. @this: The string to act on.
ExtractInt64(this string @this) Extracts an Int64 from the string. @this: The string to act on.
ExtractLetter(this string @this) Extracts letters from the string. @this: The string to act on.
ExtractManyDecimal(this string @this) Extracts all decimal numbers from the string. @this: The string to act on.
ExtractManyDouble(this string @this) Extracts all doubles from the string. @this: The string to act on.
ExtractManyInt16(this string @this) Extracts all Int16 from the string. @this: The string to act on.
ExtractManyInt32(this string @this) Extracts all Int32 from the string. @this: The string to act on.
ExtractManyInt64(this string @this) Extracts all Int64 from the string. @this: The string to act on.
ExtractManyUInt16(this string @this) Extracts all UInt16 from the string. @this: The string to act on.
ExtractManyUInt32(this string @this) Extracts all UInt32 from the string. @this: The string to act on.
ExtractManyUInt64(this string @this) Extracts all UInt64 from the string. @this: The string to act on.
ExtractNumber(this string @this) Extracts numbers from the string. @this: The string to act on.
ExtractUInt16(this string @this) Extracts a UInt16 from the string. @this: The string to act on.
ExtractUInt32(this string @this) Extracts a UInt32 from the string. @this: The string to act on.
ExtractUInt64(this string @this) Extracts a UInt64 from the string. @this: The string to act on.
Format(this string format, object arg0) Replaces format items in a string. format: A composite format string.
arg0: The object to format.
Format(this string format, object arg0, object arg1) Replaces format items with two objects. format: A composite format string.
arg0: The first object to format.
arg1: The second object to format.
Format(this string format, object arg0, object arg1, object arg2) Replaces format items with three objects. format: A composite format string.
arg0: The first object to format.
arg1: The second object to format.
arg2: The third object to format.
Format(this string format, params object[] args) Replaces format items with an array of objects. format: A composite format string.
args: An object array that contains zero or more objects to format.
FormatWith(this string @this, object arg0) Replaces format items with a single object. @this: A String containing zero or more format items.
arg0: The argument to format.
FormatWith(this string @this, object arg0, object arg1) Replaces format items with two objects. @this: A String containing zero or more format items.
arg0: The first argument to format.
arg1: The second argument to format.
FormatWith(this string @this, object arg0, object arg1, object arg2) Replaces format items with three objects. @this: A String containing zero or more format items.
arg0: The first argument to format.
arg1: The second argument to format.
arg2: The third argument to format.
FormatWith(this string @this, params object[] values) Replaces format items with an array of objects. @this: A String containing zero or more format items.
values: An Object array containing zero or more objects to format.
GetAfter(this string @this, string value) Gets the substring after the specified value. @this: The string to act on.
value: The value to search for.
GetBefore(this string @this, string value) Gets the substring before the specified value. @this: The string to act on.
value: The value to search for.
GetBetween(this string @this, string before, string after) Gets the substring between two specified values. @this: The string to act on.
before: The string before to search.
after: The string after to search.
GetNumericValue(this string s, int index) Gets the numeric value of a character at a position. s: A string.
index: The character position in the string.
GetUnicodeCategory(this string s, int index) Gets the Unicode category of a character at a position. s: A string.
index: The character position in the string.
HtmlAttributeEncode(this string s) HTML attribute encodes a string. s: The string to encode.
HtmlAttributeEncode(this string s, TextWriter output) HTML attribute encodes and writes to a TextWriter. s: The string to encode.
output: A TextWriter output stream.
HtmlDecode(this string s) HTML decodes a string. s: The string to decode.
HtmlDecode(this string s, TextWriter output) HTML decodes and writes to a TextWriter. s: The string to decode.
output: A TextWriter stream of output.
HtmlEncode(this string s) HTML encodes a string. s: The string to encode.
HtmlEncode(this string s, TextWriter output) HTML encodes and writes to a TextWriter. s: The string to encode.
output: A TextWriter output stream.
IfEmpty(this string value, string defaultValue) Returns a default value if the string is empty. value: The string to check.
defaultValue: The default value to return if empty.
In(this string @this, params string[] values) Checks if the string is equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
Intern(this string str) Retrieves the system’s reference to the string. str: A string to search for in the intern pool.
IsAlpha(this string @this) Checks if the string contains only letters. @this: The string to act on.
IsAlphaNumeric(this string @this) Checks if the string contains only letters and numbers. @this: The string to act on.
IsAnagram(this string @this, string otherString) Checks if the string is an anagram of another. @this: The string to act on.
otherString: The other string to compare with.
IsControl(this string s, int index) Checks if a character at a position is a control character. s: A string.
index: The position of the character to evaluate.
IsDigit(this string s, int index) Checks if a character at a position is a digit. s: A string.
index: The position of the character to evaluate.
IsEmpty(this string @this) Checks if the string is empty. @this: The string to act on.
IsHighSurrogate(this string s, int index) Checks if a character at a position is a high surrogate. s: A string.
index: The position of the character to evaluate.
IsInterned(this string str) Retrieves a reference to the string from the intern pool. str: The string to search for in the intern pool.
IsLetter(this string s, int index) Checks if a character at a position is a letter. s: A string.
index: The position of the character to evaluate.
IsLetterOrDigit(this string s, int index) Checks if a character at a position is a letter or digit. s: A string.
index: The position of the character to evaluate.
IsLike(this string @this, string pattern) Checks if the string matches a pattern with wildcards. @this: The string to act on.
pattern: The pattern to use. Use ‘*’ as wildcard string.
IsLower(this string s, int index) Checks if a character at a position is lowercase. s: A string.
index: The position of the character to evaluate.
IsLowSurrogate(this string s, int index) Checks if a character at a position is a low surrogate. s: A string.
index: The position of the character to evaluate.
IsMatch(this string input, string pattern) Checks if the string matches a regular expression. input: The string to search for a match.
pattern: The regular expression pattern to match.
IsMatch(this string input, string pattern, RegexOptions options) Checks if the string matches a regex with options. input: The string to search for a match.
pattern: The regular expression pattern to match.
options: A bitwise combination of the enumeration values that provide options for matching.
IsNotEmpty(this string @this) Checks if the string is not empty. @this: The string to act on.
IsNotNull(this string @this) Checks if the string is not null. @this: The string to act on.
IsNotNullOrEmpty(this string @this) Checks if the string is not null or empty. @this: The string to act on.
IsNotNullOrWhiteSpace(this string value) Checks if the string is not null, empty, or whitespace. value: The string to test.
IsNull(this string @this) Checks if the string is null. @this: The string to act on.
IsNullOrEmpty(this string @this) Checks if the string is null or empty. @this: The string to act on.
IsNullOrWhiteSpace(this string value) Checks if the string is null, empty, or whitespace. value: The string to test.
IsNumber(this string s, int index) Checks if a character at a position is a number. s: A string.
index: The position of the character to evaluate.
IsNumeric(this string @this) Checks if the string contains only numbers. @this: The string to act on.
IsPalindrome(this string @this) Checks if the string is a palindrome. @this: The string to act on.
IsPunctuation(this string s, int index) Checks if a character at a position is punctuation. s: A string.
index: The position of the character to evaluate.
IsSeparator(this string s, int index) Checks if a character at a position is a separator. s: A string.
index: The position of the character to evaluate.
IsSurrogate(this string s, int index) Checks if a character at a position is a surrogate. s: A string.
index: The position of the character to evaluate.
IsSurrogatePair(this string s, int index) Checks if two characters form a surrogate pair. s: A string.
index: The starting position of the pair of characters to evaluate.
IsSymbol(this string s, int index) Checks if a character at a position is a symbol. s: A string.
index: The position of the character to evaluate.
IsUpper(this string s, int index) Checks if a character at a position is uppercase. s: A string.
index: The position of the character to evaluate.
IsValidEmail(this string obj) Checks if the string is a valid email address. obj: The string to act on.
IsValidIP(this string obj) Checks if the string is a valid IP address. obj: The string to act on.
IsWhiteSpace(this string s, int index) Checks if a character at a position is whitespace. s: A string.
index: The position of the character to evaluate.
JavaScriptStringEncode(this string value) JavaScript encodes a string. value: A string to encode.
JavaScriptStringEncode(this string value, bool addDoubleQuotes) JavaScript encodes with optional double quotes. value: A string to encode.
addDoubleQuotes: A value that indicates whether double quotation marks will be included around the encoded string.
Join(this string separator, params string[] value) Joins an array of strings with a separator. separator: The string to use as a separator.
value: An array that contains the elements to concatenate.
Join(this string separator, params object[] values) Joins an array of objects with a separator. separator: The string to use as a separator.
values: An array that contains the elements to concatenate.
Join<T>(this string separator, IEnumerable<T> values) Joins a collection with a separator. separator: The string to use as a separator.
values: An array that contains the elements to concatenate.
Join(this string separator, IEnumerable<string> values) Joins a string collection with a separator. separator: The string to use as a separator.
values: An array that contains the elements to concatenate.
Join(this string separator, string[] value, int startIndex, int count) Joins a subset of an array with a separator. separator: The string to use as a separator.
value: An array that contains the elements to concatenate.
startIndex: The first element in value to use.
count: The number of elements of value to use.
Left(this string @this, int length) Gets the left part of the string. @this: The string to act on.
length: The length of the left part to get.
LeftSafe(this string @this, int length) Safely gets the left part (handles out-of-range). @this: The string to act on.
length: The length of the left part to get.
Match(this string input, string pattern) Searches for the first regex match. input: The string to search for a match.
pattern: The regular expression pattern to match.
Match(this string input, string pattern, RegexOptions options) Searches for the first regex match with options. input: The string to search for a match.
pattern: The regular expression pattern to match.
options: A bitwise combination of the enumeration values that provide options for matching.
Matches(this string input, string pattern) Searches for all regex matches. input: The string to search for a match.
pattern: The regular expression pattern to match.
Matches(this string input, string pattern, RegexOptions options) Searches for all regex matches with options. input: The string to search for a match.
pattern: The regular expression pattern to match.
options: A bitwise combination of the enumeration values that specify options for matching.
Nl2Br(this string @this) Converts newlines to line breaks. @this: The string to act on.
NotIn(this string @this, params string[] values) Checks if the string is not equal to any in the provided array. @this: The object to be compared.
values: The value list to compare with the object.
NullIfEmpty(this string value) Returns null if the string is null or empty. value: The string to check.
ParseQueryString(this string query) Parses a query string into a NameValueCollection. query: The query string to parse.
ParseQueryString(this string query, Encoding encoding) Parses a query string with specified encoding. query: The query string to parse.
encoding: The encoding to use.
PathCombine(this string @this, params string[] paths) Combines strings into a path. @this: The string to act on.
paths: The paths to combine.
RemoveDiacritics(this string @this) Removes diacritics from the string. @this: The string to act on.
RemoveLetter(this string @this) Removes letters from the string. @this: The string to act on.
RemoveNumber(this string @this) Removes numbers from the string. @this: The string to act on.
RemoveWhere(this string @this, Func<char, bool> predicate) Removes characters based on a predicate. @this: The string to act on.
predicate: The function to determine which characters to remove.
Repeat(this string @this, int repeatCount) Repeats the string a specified number of times. @this: The string to act on.
repeatCount: Number of repeats.
Replace(this string @this, int startIndex, int length, string value) Replaces a substring at a specific position. @this: The string to act on.
startIndex: The start index.
length: The length.
value: The replacement value.
ReplaceByEmpty(this string @this, params string[] values) Replaces specified values with an empty string. @this: The string to act on.
values: The values to replace.
ReplaceFirst(this string @this, string oldValue, string newValue) Replaces the first occurrence of a substring. @this: The string to act on.
oldValue: The value to replace.
newValue: The replacement value.
ReplaceFirst(this string @this, int number, string oldValue, string newValue) Replaces the first N occurrences of a substring. @this: The string to act on.
number: The number of occurrences to replace.
oldValue: The value to replace.
newValue: The replacement value.
ReplaceLast(this string @this, string oldValue, string newValue) Replaces the last occurrence of a substring. @this: The string to act on.
oldValue: The value to replace.
newValue: The replacement value.
ReplaceLast(this string @this, int number, string oldValue, string newValue) Replaces the last N occurrences of a substring. @this: The string to act on.
number: The number of occurrences to replace.
oldValue: The value to replace.
newValue: The replacement value.
ReplaceWhenEquals(this string @this, string oldValue, string newValue) Replaces the string if it equals a value. @this: The string to act on.
oldValue: The value to compare with.
newValue: The replacement value.
Reverse(this string @this) Reverses the string. @this: The string to act on.
Right(this string @this, int length) Gets the right part of the string. @this: The string to act on.
length: The length of the right part to get.
RightSafe(this string @this, int length) Safely gets the right part (handles out-of-range). @this: The string to act on.
length: The length of the right part to get.
SaveAs(this string @this, string fileName, bool append = false) Saves the string to a file. @this: The string to act on.
fileName: Filename of the file.
append: If the text should be appended to file if it exists.
SaveAs(this string @this, FileInfo file, bool append = false) Saves the string to a FileInfo. @this: The string to act on.
file: The FileInfo.
append: If the text should be appended to file if it exists.
Split(this string @this, string separator, StringSplitOptions option = StringSplitOptions.None) Splits the string using a separator. @this: The string to act on.
separator: A string that delimit the substrings in this string.
option: Specify RemoveEmptyEntries to omit empty array elements, or None to include empty array elements.
ToByteArray(this string @this) Converts the string to a byte array. @this: The string to act on.
ToEnum<T>(this string @this) Converts the string to an enum value. @this: The string to act on.
ToTitleCase(this string @this) Converts the string to title case. @this: The string to act on.
ToTitleCase(this string @this, CultureInfo cultureInfo) Converts to title case using specified culture. @this: The string to act on.
cultureInfo: Information describing the culture.
ToValidDateTimeOrNull(this string @this) Converts to a valid DateTime or null. @this: The string to act on.
ToXDocument(this string @this) Converts the string to an XDocument. @this: The string to act on.
ToXmlDocument(this string @this) Converts the string to an XmlDocument. @this: The string to act on.
Truncate(this string @this, int maxLength) Truncates the string to a maximum length. @this: The string to act on.
maxLength: The maximum length.
Truncate(this string @this, int maxLength, string suffix) Truncates with a suffix. @this: The string to act on.
maxLength: The maximum length.
suffix: The suffix to append when truncated.
UrlDecode(this string str) URL decodes a string. str: The string to decode.
UrlDecode(this string str, Encoding e) URL decodes with specified encoding. str: The string to decode.
e: The encoding that specifies the decoding scheme.
UrlDecodeToBytes(this string str) URL decodes to a byte array. str: The string to decode.
UrlDecodeToBytes(this string str, Encoding e) URL decodes to a byte array with encoding. str: The string to decode.
e: The encoding object that specifies the decoding scheme.
UrlEncode(this string str) URL encodes a string. str: The text to encode.
UrlEncode(this string str, Encoding e) URL encodes with specified encoding. str: The text to encode.
e: The encoding object that specifies the encoding scheme.
UrlEncodeToBytes(this string str) URL encodes to a byte array. str: The string to encode.
UrlEncodeToBytes(this string str, Encoding e) URL encodes to a byte array with encoding. str: The string to encode.
e: The encoding that specifies the encoding scheme.
UrlPathEncode(this string str) URL path encodes a string. str: The text to encode.

Jube™. © Jube Holdings Limited 2022 to present.