Text Filters

capitalize: Converts the first letter of each word to a capital letter.

Example: we have a text value of hello world and apply the capitalize filter and it becomes Hello World.

concat: Concatenates 2 text strings together by an optional separator. The value can be any text and the separator can be anything: + , -, _, etc....

Example: we have a text value of hello world and apply the concat filter and it becomes hello world+Xano.

contains: Returns whether or not the expression is found. The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the contains filter this returns a value of "true".

ends_with: Returns whether or not the expression is present at the end. The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the ends_with filter this returns a value of "false".

icontains: Returns whether or not the case-insensitive expression is found. The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the icontains filter this returns a value of "false".

iends_with: Returns whether or not the case-insensitive expression is present at the end. The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the iends_with filter this returns a value of "true".

iindex: Returns the index of the case-insensitive expression or false if it can't be found. The search term can be any string of text. This returns an integer value of where the character(s) exist in the string. The first character in a text string has an index of 0.

Example: we have a text value of hello world and apply the iindex filter this returns a value of "6".

index: Returns the index of the case-sensitive expression or false if it can't be found. The search term can be any string of text. This returns an integer value of where the character(s) exist in the string. The first character in a text string has an index of 0.

Example: we have a text value of hello world and apply the index filter this returns a value of "1".

istarts_with: Returns whether or not the case-insensitive expression is present at the beginning. The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the istarts_with filter this returns a value of "true".

ltrim: Trim whitespace or other characters from the left side and return the result. The mask text can be any string of text.

Example: we have a text value of hello world and apply the ltrim filter this returns a value of "llo world".

rtrim: Trim whitespace or other characters from the right return the result. The mask text can be any string of text.

Example: we have a text value of hello world and apply the ltrim filter this returns a value of "hello wo".

join: Joins an array of text into text via the separator and returns the result. Theseperator text can be any string of text. The array in this example is: [ hello, world, how, are, you]

Example: we have an array of text and we apply the join filter with the seperator "?" this returns: hello?world?how?are?you

replace: Replace a text phrase with another. Search can be any word in the value and the replacement can be anything.

Example: we have a text value of hello world and apply the replace filter and it becomes hello Xano.

​

split: Splits text into an array of text and returns the result. The separator can be anything the words are separated by, in this example, it is the + symbol.

Example: we have a text value of hello+world and apply the split filter and it becomes ["hello", "world"].

sprintf: formats text with variable substitution. This is used for variable replacement in your data. %d is used to replace number. %s is used to replace text. Our first example wiil show how it works to replace %d with a number.

Example: we have a text value of hello world %d and apply the sprintf filter, it becomes hello world 54321.

The second example will replace %s with text:

Example: we have a text value of hello world %s and apply the sprintf filter, it becomes hello world anything.

We can use a chain of sprintf to replace any number of values. In the example below we have 2 %d and 2 %s. The first %d is equivalent to the first argument of 123. The second %d is equivalent to the second argument of 123. The first %s is equivalent to the first argument of hi. The first %s is equivalent to the second argument of end.

This example becomes: 123 hello 789 world hi this is the end

​

starts_with: Returns whether or not the expression is present at the beginning. . The search term can be any string of text. This returns a "true" or "false" response.

Example: we have a text value of hello world and apply the istarts_with filter this returns a value of "false".

strlen: Returns the number of characters.

Example: we have a text value of hello world and apply the strlen filter and it becomes the int 11.

strpos: Returns the index of the case sensitive expression or -1 if it can't be found, the search value can be anything in the string.

Example: we have a text value of hello world and apply the strpos filter and it becomes the int 2.

substr: Extracts a section of text. The start pos is based on the # of characters from the beginning with the first char pos= 0. The length can be an int.

Example: we have a text value of hello world and apply the substr filter and it becomes wo.

​

to_lower: Converts all characters to lower case and returns the result.

Example: we have a text value of hElLO woRlD and apply the to_lower filter and it becomes hello world.

to_upper: Converts all characters to upper case and returns the result.

Example: we have a text value of hElLO woRlD and apply the to_upper filter and it becomes HELLO WORLD.

trim: Trim whitespace or other characters from both sides and return the result. The mask text can be any string of text.

Example: we have a text value of ?!hello world?! and apply the trim filter this returns a value of "hello world".

url_addarg: Parses a URL and returns an updated version with an encoded version of the supplied parameter. This filter is used to add a key(blog_id, authorname) and a value (123 , john). Those parameters would be added as ?blog_id=123 and ?authorname=john.

This URL becomes https://www.xano.com/?user_id=1 after the filter is applied

url_delarg: Parses a URL and returns an updated version with the supplied parameter removed. This filter is used to delete a key(blog_id, authorname). Those parameters would be deleted at the end of a url as ?blog_id or ?authorname.

This URL becomes https://www.xano.com/ after the filter is applied