Ensure the Load table properties are returned to their previous state. The default value for Storage > Create DDL Template is None and the Override Create DDL > Override DDL field is left blank to use the automatically generated DDL statement or ensure your custom DDL statement remains.

Controls

Controls

Description

Example

{%...%}

This is a tag for control flow. It should contain a tag and may be additional parameters, as shown in the example.

{% if ${condition} %}
${content}
{% else %}
${content}
{% endif %}


{%...%}

This is a tag for control flow. It should contain a tag and may be additional parameters, as shown in the example. If there is a - at the start or at the end, this will trim the leading or trailing whitespace respectively.

{%- if ${condition} -%}
${content}
{%- else -%}
${content}
{%- endif -%}

...

This tag is for expressions. It should contain an expression that will be outputted, as shown in the example.

{{ max(5, 3) }}

...

This tag is for expressions. It should contain an expression that will be outputted, as shown in the example. If there is a - at the start or at the end, this will trim the leading or trailing whitespace respectively.


{{- range(3, 6) -}}


{#...#}

This tag is for comments.

{# this is a comment. #}

{#...#}

This tag is for comments. If there is a - at the start or at the end, this will trim the leading or trailing whitespace respectively.

{#- No whitespace on the left #}

Pebble Template Tags

autoescape

The autoescape tag can be used to temporarily disable/re-enable the autoescaper as well as change the escaping strategy for a portion of the template.

Example

{% autoescape "js" %}
${content}
{% endautoescape %}

block

A section that can be overridden by a child template.

Template

{% block "${blockName}" %}
${content}
{% endblock %}

extends

The extends tag is used to declare a parent template. It should be the very first tag used in a child template and a child template can only extend up to one parent template.

Template

{% extends "${templateName}" %}

filter

The filter tag allows you to apply a filter to a large chunk of template.

Template

{% filter ${filter} %}
${content}
{% endfilter %}

Template 2

{% filter ${filter1} | ${filter2} %}
${content}
{% endfilter %}

for

The for tag is used to iterate through a collection or map.

Template

{% for ${i} in ${collection} %}
${content}
{% endfor %}

for else

The for tag is used to iterate through a collection or map with a convenient way to check for emptiness.

Template

{% for ${i} in ${collection} %}
${content}
{% else %}
${content}
{% endfor %}

if

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% endif %}

if else

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% else %}
${content}
{% endif %}

if elseif

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% elseif %}
${content}
{% else %}
${content}
{% endif %}

import

The import tag allows you to use macros defined in another template.

Template

{% import "${templateName}" %}

include

The include tag allows you to insert the rendered output of another template directly into the current template. The included template will have access to the same variables that the current template does.

Template

{% include "${templateName}" %}

include with

The include tag allows you to insert the rendered output of another template directly into the current template. The included template will have access to the same variables that the current template does with additional variables.

Template

{% include "${templateName}" with { ${mapOfVariables} } %}

macro

The macro tag allows you to create a chunk of reusable and dynamic content. The macro can be called multiple times in the current template or even from another template with the help of the import tag.

Example

{% macro concat(left, right) %}
{{ left }} {{ right }}
{% endmacro %}

parallel

The parallel tag allows you to designate a chunk of content to be rendered using a new thread.

Template

{% parallel %}
${content}
{% endparallel %}

set

The set tag allows you to define a variable in the current context, whether it currently exists or not.
Will initialize the variable or override the current value in the variable.

Template

{% set ${variable} = ${value} %}

verbatim

The verbatim tag allows you to write Pebble syntax that won't be parsed.

Example

{% verbatim %}
{% if not varA is defined %}
{% set varA = "Abc" %}
{% endif %}
{% endverbatim %}

br

The br tag adds a line break token at the current position.
Use an additional parameter to change the type of line break: lf (Default), crlf, other "token".

Template

{% verbatim %}
{% if not varA is defined %}
{% set varA = "Abc" %}
{% endif %}
{% endverbatim %}

counter

The counter tag outputs an integer value that is incremented by one for each use.
Use the parameter local to make the counter increments per used template.

Example

{% verbatim %}
{% if not varA is defined %}
{% set varA = "Abc" %}
{% endif %}
{% endverbatim %}

Output

1 pencil
2 pens

Example 2

Template "Other": {% counter local %}
Main template: {% counter local %}{% include "Other" %}

Outputs

11

declare

The declare tag allows you to define a variable in the current context if it does not exist. If the variable does exist it will not be changed.

The following are the same:

{% declare encapsulation = true %}
{% set encapsulation = encapsulation | default(true) %}


Example

{% set varA = "aa" %}
{% declare varA = "bb" %}
{% declare varB = "cc" %}
{{ varA }} {{ varB }}

Outputs

aa cc

error

The error tag allows you to fail to generate the template with an error message, e.g. if something unexpected occurs.

Example

{% if not requiredVar is defined %}
{% error "Something terrible has occurred" %}

indent

The indent tag adds one or more 4-space indents at the current position.

Example

{% indent %}

Example 2

{% indent 3 %}

from

The from tag is used to iterate a subset of a collection defined by the where condition.

Template

{% from ${collection} as ${var} where ${test} %}
${content}
{% endfrom %}

Example 

{% from range(1,10) as num where num is even %}
{{- num }}{% br %}
{% endfrom %}

Output

2
4
6
8
10

from else

The from tag is used to iterate a subset of a collection defined by the where condition with a convenient way to check for emptiness.

Template

{% from ${collection} as ${var} where ${test} %}
${content}
{% else %}
${content}
{% endfrom %}

Example 

{% from [] as num where num is even -%}
Even numbers{% br %}
{% else -%}
Empty collection{% endfrom %}

Output

Empty collection

list add

The list with add tag is used to append a value to a list.

Example 

{% set alphabet = ["a", "b", "c"] %}
{{ alphabet }}{% br %}
{% list alphabet add "d" -%}
{{ alphabet }}

Output

[a, b, c]
[a, b, c, d]

list adds

The list with add tag is used to append one or more values to a list.

Example 

{% set alphabet = ["a", "b", "c"] %}
{{ alphabet }}{% br %}
{% list alphabet add "d", "e", "f" -%}
{{ alphabet }}

Output

[a, b, c]
[a, b, c, d, e, f]

list remove

The list with remove tag is used to remove a value from a list.

Example 

{% set alphabet = ["a", "b", "c", "d", "e", "f"] %}
{{ alphabet }}{% br %}
{% list alphabet remove "d" -%}
{{ alphabet }}

Output

[a, b, c, d, e, f]
[a, b, c, e, f]

list removes

The list with remove tag is used to remove one or more values from a list.

Example 

{% set alphabet = ["a", "b", "c", "d", "e", "f"] %}
{{ alphabet }}{% br %}
{% list alphabet remove "d" -%}
{{ alphabet }}

Output

[a, b, c, d, e, f]
[a, b, c, e, f]

map put

The map put tag is used to set a key-value pair into a map, whether it currently exists or not.

Template

{% map ${mapVar} put ${key} = ${value} %}

map remove

The map remove tag is used to remove a key from a map.

Template

{% map ${mapVar} remove ${key} %}

placebottom

The placebottom tag allows defining a block in the template that will be placed at the end of the output. The priority argument defines the order of multiple place bottom blocks.

Template

{% placebottom ${priority} %}
${content}
{% endplacebottom %}

get

The get tag defines a variable as a subset of a collection based on the given condition.

Example

{% get evenNums from range(1,10) as num where num is even %}
{{ evenNums }}

Output

[2, 4, 6, 8, 10]

WhereScape RED Specific Tag

fetch

The fetch tag is used to manually load attributes of objects that aren't loaded automatically, eg. for an alternate table.

Example

{% for col in table.columns %}
{% fetch col.sourceTable %}
{% set srcTab = col.sourceTable %}
{% for srcCol in srcTab.columns %}
{{ srcCol.source }}{% br %}
{% endfor %}
{% endfor %}

Pebble Template Functions

block

The block function is used to render the contents of a block tag more than once.

Example

{% block "testBlock" %}Some content
{% endblock %}
{{ block("testBlock") }}

Output

Some contentSome content

max

The max function will return the largest of it's numerical arguments.

Example

{{ max(5, 3) }}

Output

5

min

The min function will return the smallest of it's numerical arguments.

Example

{{ max(5, 3) }}

Output

3

parent

The parent function is used inside of a block to render the content that the parent template would have rendered inside of the block had the current template not overriden it.

Template

{% block "${blockName}" %}
{{ parent() }}
{% endblock %}

range

The range function will return a list containing an arithmetic progression of numbers.

Example

{{ range(3, 6) }}

Output

[3, 4, 5, 6]

range with step

The range function will return a list containing an arithmetic progression of numbers.

Example

{{ range(2, 10, 2) }}

Output

[2, 4, 6, 8, 10]

bool

The bool function will return a boolean from parsing a value.

Example

{{ bool("T") }}

Output

true

Example

{{ bool(0) }}

Output

false

codepoint

The codepoint function will return the character for the specified Unicode code point.

Example

{{ codepoint(34) }}

Output

"

combine lists

The combineLists function will return a merged list of the two arguments.

Example

{% set listA = [ "a", "b", "c" ] %}
{% set listB = [ "d", "c", "e" ] %}
{{ combineLists(false, listA, listB) }}
{{ combineLists(true, listA, listB) }}

Output

[a, b, c, d, c, e][a, b, c, d, e]

double

The double function will return an int for the provided Number argument or attempt to parse a String into a double.

Example

{{ double(3.145) }}

Output

3.145

Example 2

{{ double("3.145") }}

Output

3.145

int

The int function will return an int for the provided Number argument or attempt to parse a String into an int.

Example

{{ int(3.145) }}

Output

3

Example 2

{{ int("3.145") }}

Output

3

replace start

The replaceStart function will return a String where str will be checked if it starts with match and if so be replaced with replace.

Example

{{ replaceStart("prefix", "pre", "suf", false) }}

Output

suffix

replace end

The replaceEnd function will return a String where str will be checked if it ends with match and if so be replaced with replace.

Example

{{ replaceEnd("completion", "ion", "ed", false) }}

Output

completed

str is equals

The strIsEquals function will return a boolean for whether the provided String arguments are equal. Safely handles null values.

Example

{{ strIsEquals("a", "A", true) }}

Output

true

Example 2

{{ strIsEquals("a", null) }}

Output

false

starts with ignore case

The startsWithIgnoreCase function will return a boolean for whether the provided str begins with match while ignoring casing.

Example 

{{ startsWithIgnoreCase("SuperMan", "super") }}

Output

true

ends with ignore case

The endsWithIgnoreCase function will return a boolean for whether the provided str ends with match while ignoring casing.

Example 

{{ endsWithIgnoreCase("SuperMan", "man") }}

Output

true

Pebble Template Filters

abbreviate

The abbreviate filter will abbreviate a string using an ellipsis. It takes one argument which is the max width of the desired output including the length of the ellipsis.

Example 

{{ "This is a sentence" | abbreviate(7) }}

Output

This...

abs

The abs filter is used to obtain the absolute value.

Example 

{{ -5 | abs }}

Output

5

capitalize

The capitalize filter will capitalize the first letter of the string.

Example 

{{ "this is a sentence" | capitalize }}

Output

This is a sentence

date

The date filter is used to format an existing java.util.Date object. The filter will construct a java.text.SimpleDateFormat using the provided pattern and then use this newly created SimpleDateFormat to format the provided Date object.
The alternative way to use this filter is to use it on a string but then provide two arguments. The first is the desired pattern for the output and the second is the existing format used to parse the input string into a java.util.Date object.

Example: If todayDate is a java.util.Date object

{{ todayDate | date("yyyy-MM-dd") }}

Output

2017-12-25

Example 2

{{ "December 25, 2017" | date("yyyy-MM-dd", existingFormat="MMMM dd, yyyy") }}

Output

2017-12-25

default

The default filter will render a default value if and only if the object being filtered is empty. A variable is empty if it is null, an empty string, an empty collection, or an empty map.

Example 

{%- set str = "" -%}
{{ str | default("NonEmpty") }}

Output

NonEmpty

escape

The escape filter will turn special characters into safe character references to avoid XSS vulnerabilities.

Example 

{{ "<content>" | escape }}

Output

<content>

first

The first filter will return the first item of a collection or the first letter of a string.

Example

{{ "Some letters" | first }}

Output

S

Example 2

{{ [ "b", "a", "c" ] | first }}

Output

b

join

The join filter will concatenate all items of a collection into a string. An optional argument can be given to be used as the separator between items.

Example

{{ [ "This", "is", "a", "sentence" ] | join }}

Output

This is a sentence

Example 2

{{ [ "This", "is", "a", "sentence" ] | join(" ") }}

Output

This is a sentence

last

The last filter will return the last item of a collection or the last letter of a string.

Example

{{ "Some letters" | last }}

Output

s

Example 2

{{ [ "b", "a", "c" ] | last }}

Output

c

length

The length filter returns the number of items of collection, map, or the length of a string.

Example

{{ "Some letters" | length }}

Output

12

Example 2

{{ [ "b", "a", "c" ] | length }}

Output

3

lower

The lower filter makes an entire string lowercase.

Example

{{ "THIS IS A SENTENCE" | lower }}

Output

this is a sentence

merge

The merge filter returns a new map, list, or array that is the result of merging two maps, lists, or arrays.

Keys in the second map will overwrite the first map keys.

Example

{%- set mapa = { "a": "aa", "b": "bb", "c": "cc" } -%}
{%- set mapb = { "c": "ccc", "d": "ddd", "e": "eee" } -%}
{{ mapa | merge(mapb) }}

Output

{a=aa, b=bb, c=ccc, d=ddd, e=eee}

numberformat

The numberformat filter is used to format a decimal number. Behind the scenes, it uses java.text.DecimalFormat.

Example

{{ 3.14678 | numberformat("#.##") }}

Output

3.15

raw

The raw filter prevents the output of an expression from being escaped by the autoescaper. The raw filter must be the very last operation performed within the expression otherwise the autoescaper will deem the expression as potentially unsafe and escape it regardless.

If the raw filter is not the last operation performed then the expression will be escaped.

Example

{{ "<content>" | raw }}

Output

<content>

replace

The replace filter returns a string that is the result of replacing any substrings matching keys in a map with the respective values.

Example

{{ "This is a sentence" | replace({ "i": "eye" }) }}

Output

Theyes eyes a sentence

rsort

The rsort filter will sort a list in reversed order. The items on the list must implement Comparable.

Example

{{ [ "b", "a", "c" ] | rsort }}

Output

[c, b, a]

slice

The slice filter returns a portion of a list, array, or string. The indexing starts at 0.

Example

{{ "This is a sentence" | slice(5, 9) }}

Output

is a

Example 2

{{ [ "b", "a", "c" ] | slice(1, 2) }}

Output

[a[

sort

The sort filter will sort a list. The items on the list must implement Comparable.

Example

{{ [ "b", "a", "c" ] | sort }}

Output

[a, b, c[

title

The title filter will capitalize the first letter of each word.

Example

{{ "This is a sentence" | title }}

Output

This Is A Sentence

trim

The trim filter is used to trim whitespace off the beginning and end of a string.

Example

{{ " Some letters " | trim }}

Output

Some letters

upper

The upper filter makes an entire string upper case.

Example

{{ "this is a sentence" | upper }}

Output

THIS IS A SENTENCE

urlencode

The urlencode filter translates a string into application/x-www-form-urlencoded format using the UTF-8 encoding scheme.

Example

{{ "list=[a,b,c]" | urlencode }}

Output

list%3D%5Ba%2Cb%2Cc%5D

lines

The lines filter will split a string by its line breaks with each line becoming an element in a list.

Example

{%- set aStr = "Something
Is
On
Lots
Of
Lines" -%}
{{ aStr | lines }}

Output

[Something, Is, On, Lots, Of, Lines]

Pebble Template Tests

defined

The defined test checks if a variable exists.

Example

{%if someVar is defined%}   
...
{%endif %}

empty

The empty test checks if a variable is empty. A variable is empty if it is null, an empty string, an empty collection, or an empty map.

Example

{% if "" is empty %}   
...
{% endif %}

even

The even test checks if an integer is even.

Example

{% if 2 is even %}   
...
{% endif %}

iterable

The iterable test checks if a variable implements java.lang.Iterable.

Example

{% if [ "a", "b", "c" ] is iterable %}   
...
{% endif %}

map

The map test checks if a variable is an instance of a map.

Example

{% if { "a": "aa", "b": "bb" } is map %}   
...
{% endif %}

null

The null test checks if a variable is null.

Example

{% if someVar is null %}   
...
{% endif %}

odd

The odd test checks if an integer is odd.

Example

{% if "" is odd %}   
...
{% endif %}

boolean

The boolean test checks if the input is a Boolean or viable to be cast as a Boolean.

Example

{% if "yes" is boolean %}   
...
{% endif %}

instanceof

The instanceof test checks if the input is of the specified class.

Example

{% if "a" is instanceof ("String") %}   
...
{% endif %}

Example 2

{% if "a" is instanceof ("java.lang.String") %}   
...
{% endif %}

number

The number test checks if the input is a Number or viable to be cast as a Number. The input can be either a numeric value or a String.

Example

{% if3.14 is number %}   
...
{% endif %}

Example 2

{% if "3.14" is number %}   
...
{% endif %}

string

The string test checks if the input is a String.

Example 

{% if "a" is string %}
...
{% endif %}

Pebble Template Variables

StringUtil

Provides common string function support.

FunctionDescriptionDatatype
capitalize(String str)Capitalizes a String, Changing the first character to title case.String

Example

{{ StringUtils.capitalize("word") }}

Output

Word
compare(String str1, String str2)Compare two Strings lexicographically.
  • Returns -1 when str1 is less than str2.
  • Returns 0 when str1 and str2 are equal.
  • Returns 1 when str1 is greater than str2.
int

Example

{% if (StringUtils.compare("lower", "upper") > 0) %}
…
{% endif %}
compare(String str1, String str2, boolean nullIsLess)Compare two Strings lexicographically.
  • Returns -1 when str1 is less than str2.
  • Returns 0 when str1 and str2 are equal.
  • Returns 1 when str1 is greater than str2.
int

Example 

{% if (StringUtils.compare("lower", "upper", false) > 0) %}
…
{% endif %}
compareIgnoreCase(String str1, String str2)Compare two Strings lexicographically, ignoring case differences.
  • Returns -1 when str1 is less than str2.
  • Returns 0 when str1 and str2 are equal.
  • Returns 1 when str1 is greater than str2.
int

Example 

{% if (StringUtils.compareIgnoreCase("lower", "upper") > 0) %}
…
{% endif %}
compareIgnoreCase(String str1, String str2, boolean nullIsLess)Compare two Strings lexicographically, ignoring case differences.
  • Returns -1 when str1 is less than str2.
  • Returns 0 when str1 and str2 are equal.
  • Returns 1 when str1 is greater than str2.
int

Example 

{% if (StringUtils.compareIgnoreCase("lower", "upper", false) > 0) %}
…
{% endif %}
countMatches(String str, String pattern)Returns the number of times the pattern appears in the stringint

Example 

{{ StringUtils.countMatches("AaaaaaA", "a") }}

Output

5
indexOf(String str, String search)Returns the index (Starts with zero) within the String of the first occurrence of the specified search String.int

Example 

{{ StringUtils.indexOf("abcabcabc", "c") }}

Output

2


indexOf(String str, String search, int startPos)Returns the index (Starts with zero) within the String of the first occurrence of the specified search String starting from the provided zero based indexint

Example 

{{ StringUtils.indexOf("abcabcabc", "c", int(4)) }}

Output

5


indexOfIgnoreCase(String str, String search)Returns the case insensitive index (Starts with zero) within the String of the first occurrence of the specified search String.int

Example 

{{ StringUtils.indexOfIgnoreCase("ABCABCABC", "c") }}

Output

2


indexOfIgnoreCase(String str, String search, int startPos)Returns the case insensitive index (Starts with zero) within the String of the first occurrence of the specified search String starting from the provided zero based index.int

Example 

{{ StringUtils.indexOfIgnoreCase("ABCABCABC", "c", int(4)) }}

Output

5


isAllLowerCase(String str)Checks if the String contains only lowercase characters.boolean

Example 

{{ StringUtils.isAllLowerCase("letters") }} {% br %}
{{ StringUtils.isAllLowerCase("leTTers") }}

Output

true
false


isAllUpperCase(String str)Checks if the String contains only uppercase characters.boolean

Example 

{{ StringUtils.isAllUpperCase("LETTERS") }} {% br %}
{{ StringUtils.isAllUpperCase("leTTers") }} 

Output

true
false


isAlpha(String str)Checks if the String contains only unicode letters.boolean

Example 

{{ StringUtils.isAlpha("letters") }}{% br %}
{{ StringUtils.isAlpha("Num1") }}

Output

true
false


isAlphanumeric(String str)Checks if the String contains only unicode letters or digits.boolean

Example 

{{ StringUtils.isAlphanumeric("Number3") }}{% br %}
{{ StringUtils.isAlphanumeric("Number 3") }}

Output

true
false


isAlphanumericSpace(String str)Checks if the String contains only unicode letters, digits or space.boolean

Example 

{{ StringUtils.isAlphanumericSpace("Number 3") }}

Output

true


isAlphaSpace(String str)Checks if the string contains only unicode letters or space.boolean

Example 

{{ StringUtils.isAlphaSpace("next letter") }}{% br %}
{{ StringUtils.isAlphaSpace("Number 3") }}

Output

true
false


isNumeric(String str)Checks if the String contains only unicode digits.boolean

Example 

{{ StringUtils.isNumeric("123") }}{% br %}
{{ StringUtils.isNumeric("Number2") }}

Output

true
false


isNumericSpace(String str)Checks if the String contains only unicode digits or space.boolean

Example 

{{ StringUtils.isNumericSpace("1 2 3") }}{% br %}
{{ StringUtils.isNumericSpace("Johnny 5") }}

Output

true
false


isWhitespace(String str)Checks if the String contains only whitespace.boolean

Example 

{{ StringUtils.isWhitespace(" ") }}{% br %}
{{ StringUtils.isWhitespace(" letter ") }}

Output

true
false


lastIndexOf(String str, String search)Returns the index (Starts with zero) within the String of the last occurrence of the specified search String.

Example 

{{ StringUtils.lastIndexOf("abcabcabc", "a") }}

Output

6


lastIndexOf(String str, String search, int startPos)Returns the index (Starts with zero) within the String of the last occurrence of the specified search String starting from the provided zero based index.

Example 

{{ StringUtils.lastIndexOf("abcabcabc", "a", int(2)) }}

Output

0


lastIndexOfIgnoreCase(String str, String search)Returns the case insensitive index (Starts with zero) within the String of the last occurrence of the specified search String.int

Example 

{{ StringUtils.lastIndexOfIgnoreCase("ABCABCABC", "a") }}

Output

6


lastIndexOf(String str, String search, int startPos)Returns the case insensitive index (Starts with zero) within the String of the last occurrence of the specified search String starting from the provided zero based index.int

Example 

{{ StringUtils.lastIndexOfIgnoreCase("ABCABCABC", "a", int(2)) }}

Output

0


leftPad(String str, int size)Left pad a String with spaces.String

Example 

T{{ StringUtils.leftPad("1", int(5) }}T

Output

T 1T


repeat(String str, int repeat)Repeat a String repeat times to form a new String.String.

Example 

{{ StringUtils.repeat("haha", int(5)) }}

Output

hahahahahahahahahaha


repeat(String str, String separator, int repeat)Repeat a String repeat times to form a new String, with a String separator injected each time.

Example 

{{ StringUtils.repeat("haha", " ", int(5)) }}

Output

haha haha haha haha haha


reverse(String str)Reverses a StringString

Example 

{{ StringUtils.reverse("abcde") }}

Output

edcba


rightPad(String str, int size)Right pad a String with spaces.String

Example 

T{{ StringUtils.rightPad("1", int(5) }}T

Output

T1 T


splitByCharacterType(String str)

Splits a String into an array of String with each element containing a substring based on the character type.

Character types include: lower case, upper case, numbers, whitespace, math operators

String[]

Example 

{% set array = StringUtils.splitByCharacterType("
AbcdEFG%++-/3432 ") %}
Split content:{%- br -%}
{%- for item in array -%}
{{ item }}{%- br -%}
{%- endfor -%}
EndSplit

Output

Split content:
A
bcd
EFG
%
++
- /
3432
EndSplit


splitByCharacterTypeCamelCase(String str)

Splits a String into an array of String with each element containing a substring based on the character type with the special case to maintain one upper case letter followed by some lower case letters as an element.

Character types include: lower case, upper case, numbers, whitespace, math operators

String[]

Example 

{% set array = StringUtils.splitByCharacterTypeCamelCase(
" AbcdEFGhij%++-/3432 ") %}
Split content:{%- br -%}
{%- for item in array -%}
{{ item }}{%- br -%}
{%- endfor -%}
EndSplit

Output

Split content:
Abcd
EF
Ghij
%
++
-
/
3432
EndSplit


swapCase(String str)Swaps the case of a String changing upper and title case to lower case, and lower case to upper case.String

Example 

{{ StringUtils.swapCase("UPPER lower") }}

Output

upper LOWER


trim(String str)Removes whitespace from both ends of the String.String

Example 

T{{ StringUtils.trim(" island ") }}T

Output

TislandT


uncapitalize(String str)Uncapitalizes a String, changing the first character to lowercase.String

Example 

{{ StringUtils.uncapitalize("WORD") }}

Output

wORD


  • No labels