Step Functions - how to join an array?

0

As of now there is a States.StringSplit($.inputString, $.splitter) intrinsic function to split an string into an array. Is there a way to join an array into an string? Something like States.ArrayJoin($.inputString, $.joiner)? Is there any work around to achieve something like that?

Reason is that I want to replace a character in a string, since there is no replace I thought about splitting and joining which does have the same effect. I'm using an activity and building an url with the taskToken, but unfortunately any "+" character get's replace by a space, so I want to replace it with "%2B".

Jonas
asked 8 months ago736 views
1 Answer
0

One option will be to use States.Format() and pass the array contents if the array length is fixed.

AWS
answered 8 months ago
  • Thanks, unfortunately the output of an taskToken does not have an constant number of "+". I already thought about a loop which combines always 2 array values as long as there are more than 1 value in the array. But for an Standard function that's also pretty expensive. Would be nice if there is a native function to achieve that.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions