Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-17-2021 09:12 AM
I would like to convert a property of nodes which is a integer to a string. I would use the toString()-function for that, but I need to convert them to a fixed length of the string. So there are some leading zeroes which need to be included in the string.
123 -> "123"
12 -> "012"
1 -> "001"
Is there any option for that in Cypher or Apoc?
Thank you,
JJJ
Solved! Go to Solution.
03-17-2021 01:10 PM
yes.. for example
return apoc.text.lpad('1', 3, '0')
results in
001
and
return apoc.text.lpad('123', 3, '0')
results in
123
see apoc.text.lpad - APOC Documentation for more details
03-17-2021 01:10 PM
yes.. for example
return apoc.text.lpad('1', 3, '0')
results in
001
and
return apoc.text.lpad('123', 3, '0')
results in
123
see apoc.text.lpad - APOC Documentation for more details
03-17-2021 02:01 PM
Thank you, very much appreciated!
All the sessions of the conference are now available online