> This page is for Docs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# String utilities

> This reference provides the sample string utilities in Liquid expressions.

This reference provides the sample string utilities in Liquid expressions.

## to_json

Convert the format from hash to JSON.

```json
{{ Data.Workflow | to_json }}
{% comment %} {"ExecutionDate":"2021-01-01","LastRunDate":"2020-12-31"...} {% endcomment %}
```

## parse_json

Convert the format from JSON to hash.

```json
{% assign input = '{"name":"INV-100","balance":1}' | parse_json %}
{{ input }}
{% comment %} {"name"=>"INV-100","balance"=>1} {% endcomment %}
```

## string_escape

Escape special characters.

```json
{{ '\abc\' | string_escape }} 
{% comment %} \\abc\\ {% endcomment %}
```

## to_xml

Convert the format from hash to XML.

```json
{{ Data.Workflow | to_xml}}
{% comment %} <?xml version="1.0" encoding="UTF-8"?><hash><ExecutionDate>2021-01-01</ExecutionDate>...</hash> {% endcomment %}
```

## regex

Return array of strings that match the regular expression.

Parameters: input, regular expression, operation\['match_first', 'match_all']

```json
{{ 'INV-100,INV-101' | regex: 'INV-\d+', 'match_first' }}
{% comment %} ["INV-100"] {% endcomment %}
{{ 'INV-100,INV-101' | regex: 'INV-\d+', 'match_all' }}
{% comment %} ["INV-100","INV-101"] {% endcomment %}
```

## input_byte_8x

Add spaces to a string to reach the byte mark.

```json
{{ 'abc' | input_byte_8x }}
{% comment %} 'abc     ' {% endcomment %}
```