Remove white space and parenthsis from global from entry variable I am using a phone number in a global variable called {{ global.phone }} with the format "(555) 555-5555". I'd like to use that same variable/string and remove spaces, dash, and parenthesis to use for the href tel link. I've tried a few different things from Twig and Craft documentation, but nothing is working. Here's what I have right now.

&lt;p&gt;Ph: &lt;a href="tel:{{ global.phone|trim(' ') }}"&gt;{{ global.phone }}&lt;/a&gt;&lt;br/&gt;


Is this possible to do? If so any advise how to accomplish this?
I haven't tried this but I think that you can use the twig replace function. Something like:

{{ global.phone|replace({"(":"", ")":"", "-":"", " ":""}) }}


Update In your case, since the prefix (1-) is required, and "-" are allowable, the replace string for "(555) 555-5555" would be:

{{ global.phone|replace({"(" : "1-", ") " : "-"}) }}