Text Filters

Text Filters

Text filters allow you to do creative adjustments to strings of text. They are placed within an output tag {{ }} and are separated with a pipe character '|'.

 

Append

Show Details
Server: v1.0 Mobile: v1.0

Adds a given string to the end of the input.

 

Capitalize

Show Details
Server: v1.0 Mobile: v1.0

Capitalizes the first letter of each word in the string. The string 'lorem ipsum dolor' would become 'Lorem Ipsum Dolor'.

 

Decrypt

Show Details
Server: v7.4

Decrypts an encrypted value.

 

Default

Show Details
Server: v3.0 Mobile: v1.0

Returns the passed default value if the value is undefined or empty, otherwise the value of the variable.

 

Downcase

Show Details
Server: v1.0 Mobile: v1.0

This filter transforms all characters in the string to lower case. The string 'LoRem IpSum DoLor' would become 'lorem ipsum dolor'.

 

Encrypt

Show Details
Server: v16.3

Encrypts a string of text using the encryption key configured for the current Rock instance.

 

Escape

Show Details
Server: v1.0 Mobile: v1.0

HTML encode string. All <tags> will be encoded to '&lt;tags&gt;'

 

EscapeDataString (aka UrlEncode)

Show Details
Server: v5.0 Mobile: v1.0

Converts a string to its escaped representation using Uri.EscapeDataString (aka URL Encoding).

 

EscapeOnce

Show Details
Server: v16.0

HTML encodes a string without changing any existing encoding. All <tags> will be encoded to '&lt;tags&gt;', whereas previously encoded text such as '&lt;tags&gt;' won't be modified.

 

FromMarkdown

Show Details
Server: v5.0

Converts a string of Markdown to HTML. See the Commonmark website for details on Markdown syntax.

 

HtmlDecode

Show Details
Server: v4.0

Decodes an escaped string of HTML.

 

Humanize

Show Details
Server: v1.0 Mobile: v1.0

This filter takes computer friendly strings like 'camelCase', 'underscore_a_point' or 'css-classes' and makes them friendly to us humans... 'Camel case', 'underscore a point' or 'css classes'.

 

Linkify

Show Details
Server: v8.0

Convert strings within the text that appear to be http/ftp/https links into clickable html links

 

NewlineToBr

Show Details
Server: v1.0 Mobile: v1.0

Add <br/> tags in front of all newlines in the string

 

ObfuscateEmail

Show Details
Server: v4.0 Mobile: v1.0

Hides the details of an email address with enough information to confirm that it was sent to an address the user would recognize.

 

Pluralize

Show Details
Server: v1.0 Mobile: v1.0

Pluralizes the provided input while taking irregular and uncountable words into consideration.

 

PluralizeForQuantity

Show Details
Server: v4.0 Mobile: v1.0

Pluralizes the provided word if the quantity provided neither 1 (or -1).

 

Possessive

Show Details
Server: v4.0 Mobile: v1.0

Returns the possessive form of the string.

 

Prepend

Show Details
Server: v1.0 Mobile: v1.0

Adds a given string to the beginning of the input.

 

ReadTime

Show Details
Server: v10.0 Mobile: v1.0

Calculates the approximate reading time for a given string.

 

RegExMatch

Show Details
Server: v5.0 Mobile: v1.0

Tests the input against a Regular Expression to determine if it is a match.

 

RegExMatchValue

Show Details
Server: v9.0 Mobile: v1.0

Tests the input against a Regular Expression and returns the matching substring if a match is made; otherwise it returns nothing.

 

RegExMatchValues

Show Details
Server: v11 Mobile: v1.0

Tests the input against a Regular Expression and returns an array of the matching substrings. If no match is made, it will return an empty array.

 

RegExReplace

Show Details
Server: v13.0

Replaces a portion of the string passed as the input to the filter with Regular Expression matching.

 

Remove

Show Details
Server: v1.0 Mobile: v1.0

Remove all occurrences of a given string.

 

RemoveFirst

Show Details
Server: v1.0 Mobile: v1.0

Removed the first occurrence of a given string.

 

Replace

Show Details
Server: v1.0 Mobile: v1.0

Replace all occurrences of a given string.

 

ReplaceFirst

Show Details
Server: v1.0 Mobile: v1.0

Replace the first occurrence of a given string.

 

ReplaceLast

Show Details
Server: v4.0 Mobile: v1.0

Replaces the last occurrence of a string pattern with a new value.

 

Right

Show Details
Server: v7.0 Mobile: v1.0

Returns the right most part of a string of the given length.

 

SanitizeSql

Show Details
Server: v8.0

Accepts a string as input and sanitizes it for use in a SQL statement.

 

SentenceCase

Show Details
Server: v1.0 Mobile: v1.0

Changes the string to be in sentence case.

 

Singularize

Show Details
Server: v1.0 Mobile: v1.0

It’s like the antidote to pluralize. Makes plural words singular.

 

Size

Show Details
Server: v1.0

Returns the length of the string, including all characters and spaces.

 

Slice

Show Details
Server: v6.0 Mobile: v1.0

The slice filter returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring of one character will be returned.

 

Split

Show Details
Server: v1.0 Mobile: v1.0

Splits a string into an array based on a matching pattern.

 

StripHtml

Show Details
Server: v1.0 Mobile: v1.0

Remove all HTML tags from the string.

 

StripNewlines

Show Details
Server: v1.0 Mobile: v1.0

Remove all new line characters (\r\n) from the string.

 

TitleCase

Show Details
Server: v1.0 Mobile: v1.0

Takes an ordinary string like 'of mice and men' and makes it usable as a title, 'Of Mice And Men'.

 

ToCssClass

Show Details
Server: v1.0 Mobile: v1.0

Converts string to a CSS class name format (e.g. home-phone).

 

ToPascal

Show Details
Server: v1.0 Mobile: v1.0

For all the programmers in the house. This will take a string and return it back in PascalCase.

 

Trim

Show Details
Server: v4.0 Mobile: v1.0

Removes all blank spaces (or instances of an optional character string) from the beginning and end of the input string.

 

TrimEnd

Show Details
Server: v14.0

Removes all blank spaces (or instances of an optional character string) from the end of the input string.

 

TrimStart

Show Details
Server: v14.0

Removes all blank spaces (or instances of an optional character string) from the beginning of the input string.

 

Truncate

Show Details
Server: v1.0 Mobile: v1.0

Will shorten the input down to the provided size and append an optional string to the end. The length of the appending string will be counted in the truncate size. If no appending string is provided '...' will be used.

 

TruncateWords

Show Details
Server: v1.0 Mobile: v1.0

Shortens the input to the number of words provided and appends an optional string to the end. If no appending string is provided it will use '...'.

 

UnescapeDataString (aka UrlDecode)

Show Details
Server: v8.0 Mobile: v1.0

Converts a string to its unescaped representation using Uri.UnescapeDataString (aka URL Decoding).

 

Upcase

Show Details
Server: v1.0 Mobile: v1.0

This filter transforms the string to all upper case. The string 'Lorem Ipsum Dolor' would become 'LOREM IPSUM DOLOR'.

 

WithFallback

Show Details
Server: v6.0 Mobile: v1.0

This filter allows you to eliminate conditional tests for null or empty values by allowing you to provide fallback text.