How can we help?

String filters are used to manipulate outputs and variables of the string type. See more string filters here, however please keep in mind that not all Liquid filters work in Rallybound's system. 

Filters on this page:

  • adverb

  • append

  • capitalize

  • downcase

  • natural_language
  • prepend

  • prepend_an_or_a
  • remove

  • replace

  • split
  • to_title_case
  • upcase

adverb

Returns the adverb of a recurring interval. Works specifically on the Recurring Donation object. Filter map the interval—

  • day to "daily
  • week to "weekly"
  • month to "monthly"
  • quarter to "quarterly"
  • year to "annually"
Input

Your card will be charged {{ Recurring_Donation.Recurring_Period | adverb }}.

Output

Your card will be charged monthly.

append

Concatenates two strings and returns the concatenated value.

Input

{{ "/my/fancy/url" | append: ".html" }}

Output

/my/fancy/url.html

append can also be used with variables:

Input

{% assign filename = "/index.html" %}
{{ "website.com" | append: filename }}

Output

website.com/index.html

capitalize

Makes the first character of a string capitalized.

Input

{{ "my great title" | capitalize }}

Output

My great title

downcase

Makes each character in a string lowercase. It has no effect on strings which are already all lowercase.

Input

{{ "Parker Moore" | downcase }}

Output

parker moore

natural_language

Prepends the word "Team" to team names that don't already have the word in their name. Works specifically on the Team.Name object.

Input

Team: {{ Team.Name }}

Join {{ Team.Name | natural_language }} today!

If team name is "Awesome Fundraisers", the output will be:

Output

Team: Awesome Fundraisers

Join Team Awesome Fundraisers today!

If team name is "Team Awesome", the output will be:

Output

Team: Team Awesome

Join Team Awesome today!

prepend

Adds the specified string to the beginning of another string.

Input

{{ "apples, oranges, and bananas" | prepend: "Some fruit: " }}

Output

Some fruit: apples, oranges, and bananas

prepend can also be used with variables:

Input

{% assign url = "example.com" %}
{{ "/index.html" | prepend: url }}

Output

example.com/index.html

prepend_an_or_a

Adds "an" or "a" before the word as grammatically appropriate. Note: only works on a single item — it does not remove the "a" or "an" for a plural version.

Input

I bought {{ fruit | prepend_an_or_a }}

If the value of fruit is "apple", the output will be:

Output

I bought an apple

If the value of fruit is "banana", the output will be:

Output

I bought a banana

remove

Removes every occurrence of the specified substring from a string.

Input

{{ "I strained to see the train through the rain" | remove: "rain" }}

Output

I sted to see the t through the 

replace

Replaces every occurrence of the first argument in a string with the second argument.

Input

{{ "Take my protein pills and put my helmet on" | replace: "my", "your" }}

Output

Take your protein pills and put your helmet on

split

Divides a string into an array using the argument as a separator. split is commonly used to convert comma-separated items from a string to an array.

Input

{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}

{% for member in beatles %}
    {{ member }}
{% endfor %}

Output

John Paul George Ringo

to_title_case

Makes the first letter of each word in a string uppercase. It has no effect on strings which are already title case.

Input

{{ "parker moore" | to_title_case }}

Output

Parker Moore

upcase

Makes each character in a string uppercase. It has no effect on strings which are already all uppercase.

Input

{{ "Parker Moore" | upcase }}

Output

PARKER MOORE