Conversion |
Input Type |
Output Type |
Description |
formatnum |
String |
String |
Take the argument string as a comma-delimited argument list. The first argument is the length of the resulting string, the second is the number of decimal places, and the third is a stuff character.
The conversion will round the input number to the required decimal place (default 0), comma the integer part to separate groups of three digits from the left of the decimal point. Then if the resulting string is shorter than the specified length, the stuff character will be pre-pended (on the right to make up the required length. |
formatnumber |
String |
String |
Same as "formatnum" |
found |
String |
String |
Return true if the argument string occurs in the input string, or false if otherwise. |
foundic |
String |
String |
Return true if the argument string occurs in the input string ignoring case, or false if otherwise. |
foundre |
String |
String |
Return true if the substring that matches the regular expression in the argument string is found in the input string, or false if otherwise. |
highlight |
String |
String |
Take the argument string as a comma-delimited argument list. The first argument is the "begin-string", the second is the "end-string", and the rest is a list of highlighted strings.
The conversion will find all occurrences of any highlighted strings from the input string and precede each with the begin-string and succeed each with the end-string.
(If the begin-string is blank, it will be taken as "<b><i><u>"; if the end-string is blank, it will be taken as "</u></i></b>".) |
hmstosec |
String |
String |
Convert a duration from the H:M:S format to the number of seconds. e.g. 2:34:56 to 9296 |
htmldisp |
String |
String |
Replace HTML sensitive characters with their proper representation. e.g. & to &, < to < and > to > |
htmlstrip |
String |
String |
Strip any HTML tags found in the input string and convert hard spaces ( ) to soft ones and multiple spaces to single ones. |
if |
String or Array |
String or Array |
Take the argument string as a comma-delimited list of two arguments. The first argument is a logical expression representing a condition. If the condition evaluates to true, return the original input string unchanged. Otherwise, return the second argument.
The second argument is sometimes called the alternative value, when the condition is not met.
If the input is an array, the second argument and onwards will form the "alternative array", which will be returned when the condition evaluates to false. |
inarray |
String |
String |
Search the input array for an element having the same value as the argument string and return true if it is found, or false if otherwise. |
inc |
String |
String |
Same as "+=" |
increase |
String |
String |
Same as "+=" |
inverse |
Array |
Array |
Convert the input array into a new array by swapping the key and the value.
e.g. if the input is k1=>v1,k2=>v2, the output will be v1=>k1,v2=>k2. If more than one element have the same values, only the key of the last element having that value will be used. |
isset |
String or Array |
String |
For input string, return true if it is defined, or false if otherwise.
For input array, return true if it is defined (even without any elements,) or false if otherwise. |
key |
Array |
Array |
Return an array which contains all the keys of the input array. The index of the output array starts from 0 (for the first element that contains the first key of the input array). |
keyof |
Array |
String |
Take the argument string as a numeric index and return the key of the element in the input array. The argument string is default to 0, which means the key of the first element. |
keys |
Array |
Array |
Same as "key" |
list |
Array |
String |
Generate a string representation of the input array according to the format specified in the argument string. The default format is:
('@key'=>'@value'),() |
|
The format contains two small brackets, defining 5 format parts:
OPEN ( REPEAT ) SEPARATOR ( BEFORELAST ) CLOSE
OPEN The string before the list
REPEAT The format of the element with the key represented by @key and value by @value.
SEPARATOR The string that comes between any two adjacent elements.
BEFORELAST The last separator. If blank, the normal separator will be used.
CLOSE The string after the list.
Here is an example:
var arr = "(array)goalie=>John, defender=>Matt, striker=>Bill"; display "{arr|list:We have (@value as the @key), ( and ); what a winning team!}";
The output would be:
We have John as the goalie, Matt as the defender and Bill as the striker; what a winning team! |
listall |
Array |
String |
Same as "list" |
listval |
Array |
String |
Same as "list" except that blank values will be excluded |
listvalue |
Array |
String |
Same as "listval" |
listvalues |
Array |
String |
Same as "listval" |
lowercase |
String |
String |
Convert a all letters in a string to lowercase. |