camunda/feel-scala

Add Trim function for whitespace stripping

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.
I have a process where user input is displayed to other users including an id for example "Do extra testing during integration", that id can then later be used by other users in commands like /markFinished Do extra testing during integration, this fails when either the initial id or the command invocation has extra whitespace that the user is not expecting.

Describe the solution you'd like
I would like there to be a trim function similar to other languages like C# where whitespace before or after the string is removed but internal whitespace is preserved.

Related issues

  • Camunda Autormation Platform 7:
  • Zeebe broker:

@jjettenCamunda thank you for reporting. 👍 This sounds like a useful function.

Proposal: add the following built-in function

// signature
trim(string): string

// examples
trim("hello world")    // --> "hello world"
trim("hello world  ")    // --> "hello world"
trim("  hello world")    // --> "hello world"
trim("  hello world  ")    // --> "hello world"
trim(" hello   world ")    // --> "hello   world"