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

One of the most revenue marketplaces, Shopify is getting more and more popular for online sellers especially in its additional functionality. Recently, Shopify has introduced the Liquidity since 2006. This Liquid tool is effective to contribute to their theme settings, which allows the online sellers to build up their professional websites. That is the reason why the Liquid now is used in all the Shopify stores or even other web applications. Furthermore, it is totally free as an open-source template. Therefore, the Shopify store owners enable having a helpful tool without paying a cost.

Particularly, Liquid codes include three main types like objects, tags, and filters, which helps online merchants to load dynamic data. Moreover, this Liquid is a useful way to configure their shops. It is easy for the Shopify shop owners to apply the most modern functionalities as well as the most beautiful themes.

With Liquid filters, online sellers can change their Liquid object’s output. As a useful tool to set up the output of a theme, Liquid filters plays an important role in changing building them. The basic structure of Liquid filters will include an object, its attribute, and the applied form of the filter. The filters are within a , for example, the which has “product” as an object and the attribute is “title”, which will be uppercased. Liquid filters is separated from left to right by a |.

In last two blogs, we introduced guides to online readers about How to Remove Whitespace tabs, spaces, and newlines and How to Remove Whitespace tabs, spaces, and newlines Left Side, we also recommend that the Shopify store owners a simple way to through this guiding article How to Remove Whitespace tabs, spaces, and newlines Right Sides in Shopify.

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

This article How to Remove Whitespace tabs, spaces, and newlines Right Sides in Shopify includes all the basic steps to remove unexpected spaces at the end of each title. The more the Shopify online sellers care about their string setting, the more outstanding their performances are. 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.