Mastersign.Expressions comes with a number of packages for standard applications. A package contains constants and functions.
A package can be loaded by calling EvaluationContext.Load...Package().
Calling EvaluationContext.LoadAllPackages() loads all packages that are currently included in Mastersign.Expressions.
not(value)- Inverts a logical value.not(true)is false andnot(false)is true
pi- The natural constant π as 64 bit floating point numbere- The natural constant e or Euler number as 64 bit floating point number
-
mod(num, den)- The residue or modulo of the division between num and den -
abs(value)- The absolute value of a number (System.Math.Abs()) -
sign(value)- Returns a 32 bit integer value, representing the sign of the number (System.Math.Sign()) -
floor(value)- Rounds a number downwards (System.Math.Floor()) -
round(value)- Rounds a number (System.Math.Round()) -
ceil(calue)- Rounds a number upwards (System.Math.Ceiling()) -
trunc(value)- Truncates the fraction of a value (System.Math.Truncate()) -
sin(value)- Computes the sine of an angle (System.Math.Sin()) -
cos(value)- Computes the cosine of an angle (System.Math.Cos()) -
tan(value)- Computes the tangent of an angle (System.Math.Tan()) -
asin(value)- Computes the angle, which sine is the given number (System.Math.Asin()) -
acos(value)- Computes the angle, which cosine is the given number (System.Math.Acos()) -
atan(value)- Computes the angle, which tangent is the given number (System.Math.Atan()) -
atan2(y, x)- Computes the angle, which tangent is the ratio of the given numbers (System.Math.Atan2()) -
sinh(value)- Computes the hyperbolic sine of an angle (System.Math.Sinh()) -
cosh(value)- Computes the hyperbolic cosine of an angle (System.Math.Cosh()) -
tanh(value)- Computes the hyperbolic tangent of an angle (System.Math.Tanh()) -
sqrt(value)- Computes the square root of the given number (System.Math.Sqrt()) -
exp(value)- Computes the given number to the power of e (Euler number) (System.Math.Exp()) -
log(value)- Computes the natural logarithm of the given number (System.Math.Log()) -
log(base, exp)- Computes the logarithm of exp to the base of base (System.Math.Log()) -
log10(value)- Computes the logarithm of the given value to the base of 10 (System.Math.Log10()) -
min(a, b)- Returns the lesser value of a and b (System.Math.Min()) -
max(a,b)- Returns the greater value of a and b (System.Math.Max()) -
rand()- Returns a random number between 0.0 and 1.0 as 64 bit floating point (System.Random.NextDouble())
All conversion functions start with the prefix c_ followed by a name describing the target type.
c_byte(value)- Converts a numerical value intoSystem.Bytec_sbyte(value)- Converts a numerical value intoSystem.SBytec_int16(value)- Converts a numerical value intoSystem.Int16c_uint16(value)- Converts a numerical value intoSystem.UInt16c_int32(value)- Converts a numerical value intoSystem.Int32c_uint32(value)- Converts a numerical value intoSystem.UInt32c_int64(value)- Converts a numerical value intoSystem.Int64c_uint64(value)- Converts a numerical value intoSystem.UInt64c_single(value)- Converts a numerical value intoSystem.Singlec_double(value)- Converts a numerical value intoSystem.Doublec_decimal(value)- Converts a numerical value intoSystem.Decimalc_str(value)- Converts an arbitrary value into aSystem.Stringby callingSystem.Object.ToString()
-
len(value)- Returns the length of a string -
to_lower(value)- Converts the casing of a string into lower case (System.String.ToLowerInvariant()) -
to_upper(value)- Converts the casing of a string into upper case (System.String.ToUpperInvariant()) -
trim(value)- Removes leading and trailing whitespaces from a string (System.String.Trim()) -
trim_start(value)- Removes leading white spaces from a string (System.String.TrimStart()) -
trim_end(value)- Removes trailing whitespaces from a string (System.String.TrimEnd()) -
substr(str, start)- Returns a rest of a string, beginning with the character at zero-based position start (System.String.Substring()) -
substr(str, start, length)- Returns a part of a string, starting with the character at zero-based position start and being length characters long (System.String.Substring()) -
left(str, count)- Returns the firstcountcharacters of the string, or the whole string, in case it is shorter thencount. -
right(str, count)- Returns the lastcountcharacters of the string, or the whole string, in case it is shorter thencount. -
remove(str, start)- Removes a trailing part from a string, starting with the character at zero-based position start (System.String.Remove()) -
remove(str, start, length)- Removes a part from a string, starting with the character at zero-based position start and being length characters long (System.String.Remove()) -
replace(str, old, new)- Replaces every occurance of new in str with old (System.String.Replace()) -
find(haystack, needle)- Searches for the first occurance of needle in haystack and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find(haystack, needle, start)- Searches for the first occurance of needle in haystack, beginning at start, and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find(haystack, needle, start, count)- Searches for the first occurance of needle in haystack, beginning at start but only for the next count characters, and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find_i(haystack, needle)- Likefind(haystack, neddle), but case-insensitive (System.String.IndexOf()) -
find_i(haystack, needle, start)- Likefind(haystack, neddle, start), but case-insensitive (System.String.IndexOf()) -
find_i(haystack, needle, start, count)- Likefind(haystack, neddle, start, count), but case-insensitive (System.String.IndexOf()) -
find_last(haystack, needle)- Searches for the last occurance of needle in haystack and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find_last(haystack, needle, start)- Searches for the last occurance of needle in haystack, beginning at start, and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find_last(haystack, needle, start, count)- Searches for the last occurance of needle in haystack, beginning at start but only for the next count characters, and returns the zero-based position of the first character of needle in haystack; if needle is not found, -1 is returned (System.String.IndexOf()) -
find_last_i(haystack, needle)- Likefind_last(haystack, needle), but case-insensitive (System.String.IndexOf()) -
find_last_i(haystack, needle, start)- Likefind_last(haystack, needle, start), but case-insensitive (System.String.IndexOf()) -
find_last_i(haystack, needle, start, count)- Likefind_last(haystack, needle, start, count), but case-insensitive (System.String.IndexOf()) -
contains(haystack, needle)- Returns true if needle is found at least once in haystack; otherwise it returns false (System.String.Contains()) -
starts_with(str, start)- Returns true if str begins with start; otherwise it returns false (System.String.StartsWith()) -
ends_with(str, end)- Returns true if str ends with end; otherwise it returns false (System.String.StartsWith()) -
min(a, b)- Returns the most less string, according to the alphabetical order -
max(a, b)- Returns the greatest string, according to the alphabetical order -
min_i(a, b)- Returns the most less string, according to the alphabetical order but case-insensitive -
max_i(a, b)- Returns the greatest string, according to the alphabetical order but case-insensitive
regex(str, pattern)- Returns true, if regular expression pattern matches str at least once (System.Text.RegularExpressions.Regex.IsMatch())regex_match(str, pattern)- Returns the first character sequence in str, matched by the regular expression pattern (System.Text.RegularExpressions.Regex.Match())regex_replace(str, patttern, new)- Replaces every match of the regular expression pattern in str by new (System.Text.RegularExpressions.Regex.Replace())