Functions
String
Contains
Returns a boolean value which is true if the string in brackets is in the base string and false if it is not.
Syntax:
Examples:
Note:
This check is case sensitive so <<(""Some Words"").Contains(""Words"")>> will return true while <<(""Some Words"").Contains(""words"")>> will return false.
EndsWith
Returns a boolean value which is true if the string in brackets is at the end of the base string and false if it is not.
Syntax:
Examples:
Note:
This check is case sensitive so <<(""Some Words"").EndsWith(""Words"")>> will return true while <<(""Some Words"").EndsWith(""words"")>> will return false.
FormatWith
Returns a string where the format items ({0}, {1}, etc.) are replaced with string representations of the corresponding parameters.
Syntax:
Examples:
IndexOf
Returns the character index of the first occurence of a reference string inside a base string. If the reference string is not in the base string then -1 is returned.
If a start index is specified, all occurences of the reference string before that index will be ignored.
Syntax:
Examples:
Note:
This check is case sensitive so <<(""Some Words"").IndexOf(""Words"")>> will return 5 while <<(""Some Words"").Contains(""words"")>> will return -1.
Insert
Returns a new string which is equal to the base string with the reference string inserted at the specified index.
Syntax:
Examples:
Note:
If the specified start index is less than 0 or more than the length of the base string then an exception will be thrown, so <<(""Some Words"").Insert(4, ""WORDS"")>> will return ""Some WORDS Words"" while <<(""Some Words"").Insert(20, ""WORDS"")>> will throw an exception.
LastIndexOf
Returns the character index of the last occurence of a reference string inside a base string. If the reference string is not in the base string then -1 is returned.
If a start index is specified, all occurences of the reference string after that index will be ignored.
Syntax:
Examples:
Note:
This check is case sensitive so <<(""Some Words"").LastIndexOf(""Words"")>> will return 5 while <<(""Some Words"").LastIndexOf(""words"")>> will return -1.
Length
Returns an integer value of the number of characters in the preceding string.
Syntax:
Examples:
Note:
Spaces are counted as characters so <<(""Some Words"").Length>> will return 10
PadLeft
Returns a new string which is equal to the base string padded with spaces at its start. If a pad character is specified, then it will be used for the padding instead of a space.
Syntax:
Examples:
PadRight
Returns a new string which is equal to the base string padded with spaces at its end. If a pad character is specified, then it will be used for the padding instead of a space.
Syntax:
Examples:
Remove
Returns a new string which is equal to the base string with all characters past the specified start index removed. If a count is specified then only that many characters are removed.
Syntax:
Examples:
Note:
If the specified start index is smaller than 0 or bigger than the length of the base string or the count added to the start index is beyond the length of the base string, then an exception will be thrown.
Replace
Returns a new string which is equal to the base string with all occurences of the a specified original string inside the base string being replaced with the specified new string.
Syntax:
Examples:
Note:
This operation is case sensitive so <<(""Some Words"").Replace(""Words"", ""word"")>> will return ""Some word"" while <<(""Some Words"").Replace(""words"", ""word"")>> will return ""Some Words"".
Split
Returns a list of strings which contains the base string split up on each space character. If a character is specified, then the string will be split on that character instead of on space.
Syntax:
Examples:
StartsWith
Returns a boolean value which is true if the string in brackets is at the beginning of the preceding string and false if it is not.
Syntax:
Examples:
Note:
This check is case sensitive so <<(""Some Words"").StartsWith(""Some"")>> will return true while <<(""Some Words"").StartsWith(""some"")>> will return false.
SubString
Returns a string which is equal to the base string from a specified index onwards. If a length is specified then only that many characters are taken from the start index onwards.
Syntax:
Examples:
Note:
If the start index is negative or bigger than the length of the base string, an exception will be thrown.
ToBytes
Converts a string value to a list of byte using the default encoding.
Syntax:
Examples:
ToBytesFromBase64
Converts a base64 string to a list of byte.
Syntax:
Examples:
ToDateTime
Returns a DateTime item using the current string and input format to perform the conversion.
Syntax:
Examples:
ToDecimal
Converts a string value to a decimal number.
Syntax:
Examples:
ToDouble
Converts a string value to a double-precision floating-point number.
Syntax:
Examples:
ToInt32
Converts a string value to a 32-bit signed integer.
Syntax:
Examples:
ToInt64
Converts a string value to a 64-bit signed integer.
Syntax:
Examples:
ToLower
Returns a string equal to the base string but all in lower case.
Syntax:
Examples:
ToUpper
Returns a string equal to the base string but all in upper case.
Syntax:
Examples:
Trim
Returns a string equal to the base string with all spaces removed from the beginning and end.
Syntax:
Examples:
TrimStart
Returns a string equal to the base string with all spaces removed from the beginning.
Syntax:
Examples:
TrimEnd
Returns a string equal to the base string with all spaces removed from the end.
Syntax:
Examples:
DateTime
AddDays
Returns a DateTime which is the specified number of days ahead of the base DateTime.
Syntax:
Examples:
AddHours
Returns a DateTime which is the specified number of hours ahead of the base DateTime.
Syntax:
Examples:
AddMilliseconds
Returns a DateTime which is the specified number of milliseconds ahead of the base DateTime.
Syntax:
Examples:
AddMinutes
Returns a DateTime which is the specified number of minutes ahead of the base DateTime.
Syntax:
Examples:
AddMonths
Returns a DateTime which is the specified number of months ahead of the base DateTime.
Syntax:
Examples:
AddSeconds
Returns a DateTime which is the specified number of seconds ahead of the base DateTime.
Syntax:
Examples:
AddYears
Returns a DateTime which is the specified number of years ahead of the base DateTime.
Syntax:
Examples:
Date
Returns a DateTime with time information stripped off.
Syntax:
Examples:
Day
Returns an integer value of the day of the month.
Syntax:
Examples:
DayOfYear
Returns an integer value of the day of the year.
Syntax:
Examples:
Hour
Returns an integer value specifying the hour value captured in the base DateTime.
Syntax:
Examples:
Millisecond
Returns an integer value specifying the millisecond value captured in the base DateTime.
Syntax:
Examples:
Minute
Returns an integer value specifying the minute value captured in the base DateTime.
Syntax:
Examples:
Month
Returns an integer value specifying the month value captured in the base DateTime.
Syntax:
Examples:
Second
Returns an integer value specifying the second value captured in the base DateTime.
Syntax:
Examples:
ToString
Returns a string value of the DateTime variable in the specified format. The format can be any combination of formatting values as shown below.
Syntax:
Allowed formatting values:
Day d, dd, ddd, dddd 1, 01, Mon, Monday
Month M, MM, MMM, MMMM 1, 01, Jan, January
Year y, yy, yyyy 4, 14,
Hours h, hh, H, HH 1, 01, 13, 13
Minutes m, mm 6, 06
Seconds s, ss 8, 08
Milliseconds f, ff, fff, ffff, fffff, ffffff, fffffff 6, 61, 615, 6157, 61574, 615743, 6157436
AM/PM t, tt A, AM
Era gg A.D.
Time and Date Separators:
- , /, –
UTC Offset:
- z, zz, zzz +2, +02, +02:00
Examples:
Year
Returns an integer value specifying the year value captured in the base DateTime.
Syntax:
Examples:
Decimal
ToDouble
Converts a decimal number to a double-precision floating-point number.
Syntax:
Examples:
ToInt64
Converts a decimal value to a 64-bit signed integer.
Syntax:
Examples:
ToString
Converts a decimal value to a string.
Syntax:
Examples:
Also see the Linx Community for more on this topic.
Double
ToDecimal
Converts a double-precision floating-point number to a decimal number.
Syntax:
Examples:
ToInt64
Converts a double value to a 64-bit signed integer.
Syntax:
Examples:
Integer
ToInt32
Converts a 64-bit signed integer to a 32-bit signed integer.
Syntax:
Examples:
List
Any
Determines whether a sequence contains any elements.
Syntax:
Examples:
Average
Computes the average of a sequence of numeric values.
Syntax:
Examples:
Count
Returns the number of elements in a sequence.
Syntax:
Examples:
Max
Returns the maximum value in a sequence of values.
Syntax:
Examples:
Min
Returns the minimum value in a sequence of values.
Syntax:
Examples:
Sum
Computes the sum of a sequence of numeric values.
Syntax:
Examples:
List(Byte)
ToBase64
Returns the list of bytes as a Base64 string.
Syntax:
Examples:
C# classes
C# has many useful classes, for example the Math class. These classes can be used in any of your Linx Expressions.
A #.
construct can be used to expose any C# classes found under the System and System.IO namespaces.
Example:
To use the Math.Abs method, type #.System.Math.Abs(MyInteger)
into an expression.