How can you remove specific characters from a string in Decisions?

Within a Flow I need to extract digits from a string of text. Is there a way I can remove specific characters from a string?

Comments

  • Hi there,


    There are a multitude of ways you can accomplish this in Decisions, but here is one solution that might work for you:


    Say I want to extract the digit “2” from the string “st2ring” making the resulting string “string”.


    To do this, you can first pass the string you want to extract digits from through the Split String step. This will allow you to split the string up with respect to a given separator. Here, I make the string separator “2”.




    The Split String step will output the broken up string as:


    We can then pass the output of the Split String step into the Merge String List To Single String subflow’s List of Strings input to reconnect the broken up string from the Split String step. You can set the Separating Character input to ignore as it will not be used. 



    The resulting output will be the reconnected string with the digit “2” extracted:


    You can then utilize an Add Item to List step to create a new list containing the resulting string with extracted digits.


    Hope this helps!

Sign In or Register to comment.