To manipulate values in grouping expressions, you can use the following methods:
Method | Return Data Type | Description | Example |
DateAdd | Date and time | Returns a date and time value to which a time interval has been added, or from which a time interval has been subtracted. The method accepts the following arguments:
| Expression DateAdd("2016-10-20T00:00:00", 7, "d")adds 7 days to the specified date, and returns 2016-10-27T00:00:00. Nested expression SnapshotCreateTime < DateAdd (DateAdd(Today, -2, "d"), 12, "h") returns True if the latest VM snapshot was created earlier than 2 days and 12 hour ago.
|
IndexOf | Numeric (integer) | Returns the position of the first occurrence of a specified value (substring) in a string. Index of the first character in a string is 0. Returns -1 if the value is not found within the string. The method accepts the following arguments:
| Expression IndexOf("vdi001_mrk", "_") returns 6. Expression IndexOf("vdi001", "_") returns -1. |
Left | Text (string) | Returns a substring that contains a specified number of characters from the left side of a string. The method accepts the following arguments:
| Expression Left("vdi001_mrk", 6) returns vdi001. Nested expression Left("vdi001_replica", IndexOf("vdi002_replica", "_")) returns vdi002. |
Length | Numeric (integer) | Returns the number of characters in a string. The method accepts a string value as an argument. | Expression Length("123456789") returns 9. For a VM, expression Length("Name") returns the number of characters in the VM name. |
Replace | Text (string) | Returns a string in which a specified substring has been replaced with another substring. The method accepts the following arguments:
Note: If the there are two or more equal substrings in a string, all substrings will be replaced. | Expression Replace("vdi002 mrk", " ", "_") changes the vdi002 mrk value to vdi002_mrk. For a VM, expression Replace(Name, "_replica", "") removes the _replica suffix from the VM name. |
Right | Text (string) | Returns a substring that contains a specified number of characters from the right side of a string. The method accepts the following arguments:
| Expression Right("vdi003_mrk", 3) returns mrk. Nested expression Right("vdi003_replica", (IndexOf("vdi003_replica", "_")) + 1) returns replica. |
Space | Text (string) | Returns a string that consists of the specified number of spaces. The method accepts a positive integer as an argument. | Nested expression Replace("vdi004_mrk", "_", Space(1)) changes the vdi004_mrk value to vdi004 mrk. |
Substring | Text (string) | Retrieves a substring from a specified string. The substring starts at the specified character position (index) and has the specified length. Index of the first character in a string is 0. The method accepts the following arguments:
| Expression Substring("vdi005_mrk", 7, 3) returns mrk. |
Trim | Text (string) | Returns a string with no leading or trailing spaces. The method accepts a string value as an argument. | Expression Trim(" vdi006 ") returns vdi006. |
TrimLeft | Text (string) | Returns a string with no leading spaces. The method accepts a string value as an argument. | Expression Trim(" vdi007") returns vdi007. |
TrimRight | Text (string) | Returns a string with no trailing spaces. The method accepts a string value as an argument. | Expression Trim("vdi008 ") returns vdi008. |
ToDate | Date and time | Converts a string containing a valid date and time representation to the DateTime format. Note: The method is based on the DateTime.TryParse method and accepts the same input values. | Expression ToDate("2009/03/12 10:30 AM") returns 2009-03-12T10:30:00. Expression ToDate("ToDate(" 2009/03/01T10:00:00-5:00") returns 2009-03-01T18:00:00. |
.ToLowerCase | Text (string) | Converts a string to lower case letters. The method accepts a string value as an argument. | Expression ToLowerCase("LoWeRCaSe") returns lowercase. |
ToUpperCase | Text (string) | Converts a string to upper case letters. The method accepts a string value as an argument. | Expression ToUpperCase("uppercase") returns UPPERCASE. |