I’m using Shopify API to request the phone number of the user by using {{customer.phone}} as a checkout script, but the request gives me a number with whitespaces between numbers like this:
123 456 789
How can I remove whitespaces from this output?
I’m using Shopify API to request the phone number of the user by using {{customer.phone}} as a checkout script, but the request gives me a number with whitespaces between numbers like this:
123 456 789
How can I remove whitespaces from this output?
2
Answers
To modify a String you need to use a Shopify String filter. You can check out more details in the documentation: https://help.shopify.com/en/themes/liquid/filters/string-filters
Below is a code which will return the phone numbers without spaces:
if you want for example to convert: