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

Liquid strip: How to Remove Whitespace tabs, spaces, and newlines Left Side in Shopify

Sam Nguyen
Sam Updated: May 07, 2024

Share:

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

Since 2006, Shopify has launched the Liquid which is an effective tool for online sellers to build the theme. As one of the best products of Shopify, the Liquid is getting more and more popular for the Shopify store owners and other web applications. Moreover, this Liquid is the open-source template, which means that the users do not pay anything for this app. With the helpful functionality, this tool is in Shopify store’s settings by contributing the theme.

Considered as a useful way to load dynamic data, Liquid allows online merchants to configure their shops with the most modern functionalities as well as the most beautiful appearances. Particularly, with the combination of three kinds of Liquid codes such as objects, tags, and filters, Liquid helps solve all the by manumitting the unit of theme effectively.

Within an output of a theme, Liquid filters plays an important role in changing the Liquid object’s output. Every Liquid filters which includes an object, its attribute, and the form of the filter is applied. For example, this filter `` has “product” as an object the title as its attribute and upercase will be the form applied. Furthermore, users can use multiple filters within an output. From left to right, Liquid filters are separated by a |.

Being on of the liquid application tutorials, We are going to learn How to modify footer.liquid in ShopifyLiquid strip: How to Remove Whitespace tabs, spaces, and newlines left side in this post.

How to Remove Whitespace tabs, spaces, and newlines Left Side in Shopify

About White spaces

If the output is not a text, the Liquid in the template output would be an empty line. Therefore, the Shopify store owners usually want to remove the empty spaces in their strings. From the beginning of a string, if online sellers wish to remove all whitespaces such as tabs, spaces or newlines, they should follow all these steps in this guiding article How to modify footer.liquid in ShopifyLiquid strip: How to Remove Whitespace tabs, spaces, and newlines left side. Because we want to even the Shopify beginners can implement this process easier, all the steps will be simple to approach.

The way to remove whitespace tabs spaces newlines left 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!          " | lstrip }}

Step 2: Output

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

To have better organizational title, it is necessary for the Shopify store owners to remove their unexpected whitespaces like tabs, spaces, and newlines. With the simple process, we hope that online merchants can refer the steps from this article How to Remove Whitespace tabs, spaces, and newlines Left Side in Shopify to delete their unwanted spaces. Besides, the Shopify sellers can discover 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.