VMware Smart AssuranceNOTIF includes the following built-in functions for use in scripting:
-
toLower (string) — Returns the string in lower case.
-
toUpper(string) — Returns the string in upper case.
-
sizeOf(string) — Returns the length of a string.
-
substr(string, startPosition, length) — Returns a substring of the string, starting at 'startPosition', for 'length' characters. The first character in the string is start position 1 (this is different from many programming languages that use 0 for the first position). If the length requested exceeds the length available, all of the remaining characters are returned. If the start position is less than 1, an evaluation error occurs. If the start position is beyond the length of the string, an empty string is returned.
-
concat(string1, string2, ... ) — Returns the concatenation of two or more strings. concat ( "a", "b", "c" ) --->"abc"
-
time(), time (formatString) — Returns the current time, optionally formatted according to a format string. The format string is the typical Java language date format string (for more information, see http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html. If no format string is provided, the system uses EEE, d MMM yyyy HH:mm:ss Z, which results in a timestamp such as: " Thu, 23 Aug 2007 16:01:21 -0400."
-
extract(string, separator, field) — Splits the string using the 'separator' and returns the 'field'. The separator value is a regular expression (for information on how to format 'separator', see http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#split(java.lang.String). If there are not enough resulting fields, an empty string is returned:
-
extract ( "1,2,3,4,5,6", "," ,4 ) --->4
-
extract ( "abcdef", "c", 2 ) --->"def"
-
extract ( "abcdef", "c", 3 ) --->""
-