Operators

String operators

Operators used to perform string operations.


$concat

Concatenates strings and returns the concatenated string.

{ "$concat": ["string", "string", "..."] }
expry({ $concat: ["marti", " ", "serra"] }); // marti serra

$ltrim

Removes whitespace characters from the beginning of a string.

{ "$ltrim": "string" }
expry({ $ltrim: "   marti" }); // marti

$regexMatch

Performs a regular expression and returns true if there is a match. Otherwise, it returns false.

{ "$regexMatch": ["string", "regex"] }
expry({ $regexMatch: ["hello", "/ell/"] }); // true
expry({ $regexMatch: ["goodbye", "/abc/"] }); // false

$rtrim

Performs a regular expression and returns true if there is a match. Otherwise, it returns false.

{ "$rtrim": "string" }
expry({ $rtrim: "marti   " }); // marti

$split

Divides a string into an array of substrings based on a delimiter.

{ "$split": ["string", "delimiter"] }
expry({ $split: ["June-15-2013", "-"] }); // ["June", "15", "2013"]
expry({ $split: ["Hello World", " "] }); // ["Hello", "World"]

$strLen

Returns the number of characters.

{ "$strLen": "string" }
expry({ $strLen: "abcde" }); // 5

$substr

Returns a substring of a string, starting at a specified index position and including the specified number of characters.

{ "$substr": ["string", "start", "length"] }
expry({ $substr: ["hello world", 1, 3] }); // ell

$toLower

Converts a string to lowercase, returning the result.

{ "$toLower": "string" }
expry({ $toLower: "Marti Serra" }); // marti serra

$trim

Removes whitespace characters from the beginning and end of a string.

{ "$trim": "string" }
expry({ $trim: "   marti serra   " }); // marti serra

$toUpper

Converts a string to uppercase, returning the result.

{ "$toUpper": "string" }
expry({ $toUpper: "Marti Serra" }); // MARTI SERRA