Home > Shopify Development > Liquid strip: How to Remove Whitespace tabs, spaces, and newlines Right Sides

Liquid strip: How to Remove Whitespace tabs, spaces, and newlines Right Sides in Shopify

Sam Nguyen
Sam Updated: May 07, 2024

Share:

Drive 20-40% of your revenue with Avada
avada email marketing

Dealing with unwanted whitespace in your Shopify store’s design? Learn how to remove excess spaces, tabs, and newlines from the left side of your content using Liquid strip. This easy technique can tidy up your layout and give your store a more polished, professional appearance. Simply follow our step-by-step guide below to using Liquid strip in Shopify to get the job done

How to Remove Whitespace tabs, spaces, and newlines Right Sides in Shopify

About White spaces

In an output, there could be multiple filters. A string can have different types of data such as texts, numbers and sometimes empty lines as whitespaces. These whitespaces which are results from tabs, spaces or newlines can be on both the left and right sides of a string. Different from spaces between words, these white spaces make the titles not professional. Therefore, it is necessary for online sellers to delete them.

The way to remove whitespace tabs spaces newlines right side

Step 1: Input

After logging into the Shopify account, the store owners go to log in their dashboard. In this example, the string with many whitespaces at the beginning and the end of the text" So much room for activities! "

Input

{{ "          So much room for activities!          " | rstrip }}

Step 2: Output

By the code rstrip ar the end of the string, we can delete the spaces on the right side of this string, so the result would be like that :

Output

So much room for activities!

Conclusion

Now that you know how to remove whitespace tabs, spaces, and newlines from the left side in Shopify, you can streamline the appearance of your store’s text elements with ease. Applying the simple steps outlined in this guide ensures a cleaner and more professional look for your Shopify theme. Try it out today, and enjoy a smoother, more polished storefront!

Besides, the online merchants can read more about Liquidity and another topic with our guiding blogs as following:


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.