如何摆脱 Neo4j 中字符串的最后一个字符?

How can I get rid of the last character of a string in Neo4j?

我有一堆格式为

的字符串
x.xx% 

或格式

xx.xx% 

x 是大于或等于零的整数。我想去掉百分号,这样我就可以将这些字符串转换为整数。如何去掉字符串中的最后一个字符?

看看string functions available in Cypher

您可以使用 Cypher 中的 replace() 字符串函数来搜索“%”的用法并替换为空字符串:

WITH replace(n.someProp, "%", "") AS value