Search code examples
neo4jspring-data-neo4jneo4j-ogm

how to remove white spaces present in string array of neo4j


I want to remove white spaces present inside the array values

(I have scor=["1 "," 1"]). Here, first value has white space on right and second value has white space on left. How to remove those white spaces in neo4j?


Solution

  • The cyper has a rich set of functions for working with strings.

    In your case, you need the trim function:

    UNWIND ["1", "2 ", " 3", " 4 "] as e
    RETURN trim(e)