The Built-in Operator

Many expressions have certain built-in attributes that you can use. The operator for built-ins is the question mark. (?) to separate it from the expression instead of the dot (.). For instance,

<assign x="welcome to the zoo">
${x?capitalize}
	

Will render as "Welcome To The Zoo", since the built-in "capitalize" will capitalize every word of the string expression to which it is applied.

The built-ins for strings are:

Built-ineffect
lengthreturns the length of the string
lower_casereturns the string in lower case
upper_casereturns the string in upper case
capitalizereturn the string with all words capitalized
trimreturns the string with leading and trailing whitespace removed
numberreturns the string converted to a number
stringsimply returns the same string, this exists for symmetry
word_listreturns a collection/sequence with substrings of the string separated by whitespace
web_safereturns the string with problematic characters such as '<" and '>" converted to the appropriate HTML entities.

The built-ins for numerical variables are:

Built-ineffect
byteconverts the number to Java byte
shortconverts the number to Java short
intconverts the number to Java int
longconverts the number to Java long
floatconverts the number to Java float
doubleconverts the number to Java double
stringconverts the number to string
numbersimply returns the same number, exists for symmetry

The built-ins for sequences are:

Built-ineffect
sizereturns the number of items in a sequence
firstreturns the first (that is, 0th) element
lastreturns the last (that is, (size-1)th) element
reversereturns a sequence with the elements in reverse order

The built-ins for hashes are:

Built-ineffect
sizereturns the number of key/value pairs in the hash
keysreturns a sequence consisting of the keys in the hash.
valuesreturns a sequence consisting of the values in the hash.