Methods

lower

lower() returns rules.String

Returns a lowercase version of the input string.

Returns

non-null rules.String the lowercase string.

Example

'ABC'.lower() == 'abc'
'ABC123'.lower() == 'abc123'

matches

matches(re) returns rules.Boolean

Performs a regular expression match on the whole string.

Parameter

re

rules.String

A regular expression using Google RE2 syntax.

Value must not be null.

Returns

non-null rules.Boolean true if the whole string matches, false otherwise.

Example

'user@domain.com'.matches('.*@domain[.]com') == true
'banana'.matches('.*@domain[.]com') == false

size

size() returns rules.Integer

Returns the number of characters in the string.

Returns

non-null rules.Integer the number of characters.

Example

'a'.size() == 1
'abc'.size() == 3

split

split(re) returns rules.List

Splits a string according to a regular expression.

Parameter

re

rules.String

A regular expression using Google RE2 syntax.

Value must not be null.

Returns

non-null rules.List a list of strings.

Example

'a/b/c'.split('/') == ['a', 'b', 'c']

trim

trim() returns rules.String

Returns a version of the string with leading and trailing spaces removed.

Returns

non-null rules.String the trimmed string.

Example

' a '.trim() == 'a'
'b'.trim() == 'b'

upper

upper() returns rules.String

Returns an uppercase version of the input string.

Returns

non-null rules.String the uppercase string.

Example

'abc'.upper() == 'ABC'
'abc123'.upper() == 'ABC123'