Skip to content
Advertisement

presto replace multiple characters

I have a string and would like to remove a set of characters. Is there a better way than chaining multiple replace()?

I came up with the following but it requires a replace() call for each character:

This is a minimal example and I have more characters to escape so I was looking for a less verbose way of achieving this. I didn’t find a string function in the documentation capable of this directly.

Thank you.

Advertisement

Answer

You can use regexp_replace to remove multiple characters:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement