String functions

The function... checks whether the value...
isEmpty (value) Is empty or null.
isNotEmpty (value) Is not empty.
startsWith (value, prefix) Starts with prefix.
contains (value, substring) Contains the given substring.
endsWith (value, suffix) Ends with the given suffix.
isLengthBetween (value, minLength, maxLength) Has a length between the specified range.

Note The range is inclusive. For example isLengthBetween ('Hello', 2, 6) is true.

isLengthLess (value, maxLength) Has a length less than the specified length.
isLengthMore (value, minLength) Has a length longer than the specified length.
isLengthEq (value, length) Has the specified string length.
isAlpha (value)

Contains only alphabetical characters.

Note This is done through the regular expression [a-zA-Z]+ .

isAlphaSpace (value) Contains only alphabetical characters and spaces.
isAlphanum (value) Contains only alphabetical characters and digits.
isAlphanumSpace (value) Contains only alphabetical characters, digits, and spaces.
matches (value, regular expression)

Matches the specified regular expression.

A regular expression has to be placed between two forward slashes (/).

Examples:

  • matches ("stream", /str.*/) checks whether stream matches the pattern str.*, which will result to true.
  • matches ("stream", /srl.*/): checks whether stream matches the pattern srl.* which results to false.