trim()
returns the original string with leading and trailing whitespace removed.
Syntax: trim(original)
Returns: A String.
Arguments
Name | Description |
original | An expression that returns a string. |
Example
RETURN trim(" Hello, World! ")
The value returned will be a string that will be similar to the original string except all the leading and trailing whitespace would have been removed. Hence the returned string will be “Hello, World!”.
Considerations
trim(null)
returnsnull
.
Example
RETURN trim(" Cypher Tutorials!")
Returns the following Result
trim(" Cypher Tutorials!") |
"Cypher Tutorials!" |
Example
RETURN trim("Cypher Tutorials! ")
Returns the following Result
trim("Cypher Tutorials! ") |
"Cypher Tutorials!" |
Example
RETURN trim(" Cypher Tutorials! ")
Returns the following Result
trim(" Cypher Tutorials! ") |
"Cypher Tutorials!" |
Example
RETURN trim("Cypher Tutorials!")
Returns the following Result
trim("Cypher Tutorials!") |
"Cypher Tutorials!" |
Example
RETURN trim(null)
Returns the following Result
trim(null) |
null |
Note– trim(null)
returns null
.