reverse()
returns a string in which the order of all characters in the original string have been reversed.
Syntax: reverse(original)
Returns: A String.
Arguments
Name | Description |
original | An expression that returns a string. |
Example
RETURN reverse("abc")
The value returned will be a string that will be the reverse of the string “Hello, World!”. Hence the returned string will be “cba”.
Considerations
reverse(null)
returnsnull
.
Example
RETURN reverse("Hello, World!")
Returns the following Result
reverse("Hello, World!") |
"!dlroW ,olleH" |
Example
RETURN reverse("Cypher Tutorials!")
Returns the following Result
reverse("Cypher Tutorials!") |
"!slairotuT rehpyC" |
Example
RETURN reverse("Racecar")
Returns the following Result
reverse("Racecar") |
"racecaR" |
Example
RETURN reverse(null)
Returns the following Result
reverse(null) |
null |
Note– reverse(null)
returns null
.