replace() returns a string in which all occurrences of a specified string in the original string have been replaced by another (specified) string.
Syntax: **replace(original, search, replace)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN replace('hello', 'l', 'w')
$$) as (str_array agtype);
Result:
split() returns a list of strings resulting from the splitting of the original string around matches of the given delimiter.
Syntax: split(original, split_delimiter)
Returns:
An agtype list of agtype strings.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN split('one,two', ',')
$$) as (split_list agtype);
Result:
left() returns a string containing the specified number of leftmost characters of the original string.
Syntax: left(original, length)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN left('Hello', 3)
$$) as (new_str agtype);
Result:
right() returns a string containing the specified number of rightmost characters of the original string.
Syntax: right(original, length)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN right('hello', 3)
$$) as (new_str agtype);
Result:
substring() returns a substring of the original string, beginning with a 0-based index start and length.
Syntax: substring(original, start [, length])
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN substring('hello', 1, 3), substring('hello', 2)
$$) as (sub_str1 agtype, sub_str2 agtype);
Result:
rTrim() returns the original string with trailing whitespace removed.
Syntax: rTrim(original)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN rTrim(' hello ')
$$) as (trimmed_str agtype);
Result:
lTrim() returns the original string with trailing whitespace removed.
Syntax: lTrim(original)
Returns:
A String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN lTrim(' hello ')
$$) as (trimmed_str agtype);
Result:
trim() returns the original string with leading and trailing whitespace removed.
Syntax: trim(original)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN trim(' hello ')
$$) as (trimmed_str agtype);
Result:
toLower() returns the original string in lowercase.
Syntax: toLower(original)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN toLower('HELLO')
$$) as (lower_str agtype);
Result:
toUpper() returns the original string in lowercase.
Syntax: toUpper(original)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN toUpper('hello')
$$) as (upper_str agtype);
Result:
reverse() returns a string in which the order of all characters in the original string have been reversed.
Syntax: reverse(original)
Returns:
An agtype String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN reverse("hello")
$$) as (upper_str agtype);
Result:
toString() converts an integer, float or boolean value to a string.
Syntax:toString(expression)
Returns:
A String.
Arguments:
Considerations:
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN toString(11.5),toString('a string'), toString(true)
$$) as (float_to_str agtype, str_to_str agtype, bool_to_string);
Result: