Operators are applied to expressions using post-fix notation with a period (.
) as the separator. For example, if a
is a string, the lc()
operator, which lowers the case of all the characters in the string, is applied to a
as follows:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
a.lc() |
Operators can be chained. The following expression splits a
into an array and then calculates the length of the resulting array:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
a.split(re/re#;/#).length() |
The following sections describe operators currently available. They are organized based on the kind of value on which they operate.
...