[ https://issues.apache.org/jira/browse/TINKERPOP-2672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733410#comment-17733410 ]
ASF GitHub Bot commented on TINKERPOP-2672: ------------------------------------------- xiazcy commented on code in PR #2099: URL: https://github.com/apache/tinkerpop/pull/2099#discussion_r1231984996 ########## gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java: ########## @@ -204,5 +204,5 @@ else if (a instanceof Collection && a instanceof Collection) public Object apply(final Object a, final Object b) { return (long) a + (long) b; } - } + }, Review Comment: ```suggestion } ``` > Add String Manipulation Steps to Gremlin > ---------------------------------------- > > Key: TINKERPOP-2672 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2672 > Project: TinkerPop > Issue Type: Improvement > Components: language > Reporter: Dave Bechberger > Priority: Major > > Today Gremlin requires that users fall back to closures to handle many common > string manipulation options that users want to do on data in the graph. This > is a problem for many users as many of the providers prevent the use of > closures due to the security risks so for these users there is no way to > manipulate strings directly. > The proposal here is to add a set of steps to handle common string > manipulation requests from users including: > * `concat(String)` - concatenates the String to the value of the traverser > * 'length()` - returns the length of the string > * `split(String)` - returns an array of strings based on the split char > passed in > * `substring(beginIndex, endIndex)` - returns a substring based on the start > and end index values passed in > * `substring(beginIndex)` - returns a substring beginning at the start index > * `rtrim()` - remove spaces at the beginning of a string > * `ltrim()` - remove spaces at the end of a string > * `trim()` - remove spaces at the beginning and end of a string > * `replace(old, new)` - replaces all occurences of the `old` string with the > `new` string > * `reverse()` - reverses the string > * `tostring()` - turns the incoming item into a string > * `toupper()` - upper cases the incoming string > * `tolower()` - lower cases the incoming string > > All the above functions except `tostring()` will throw an error if a > non-string value is passed in -- This message was sent by Atlassian Jira (v8.20.10#820010)