5.7.1.1.1. String functions

The following table shows the build-in functions in the expression language of the Code Composer related to Strings.

Name

Description

allLower

Converts all characters in a String to lower case.

allUpper

Converts all characters in a String to upper case.

camelCaseToTitleFormat

Converts String from camel case to title format

camelToAllUpperUnderscore

Converts String from camel case to all upper case with underscores

camelToKebabCase

Converts String from camel case to kebab case

camelToSnakeCase

Converts String camel case to snake case.

firstLower

Converts the first character in a String to lower case.

firstUpper

Converts the first character in a String to upper case.

5.7.1.1.1.1. allLower

The following table shows the documentation of the allLower function.

Table 5.52 allLower

Category

expression language/functions/build-in functions/String functions

Signature

allLower(String text) : String

Description

Converts all characters in a String to lower case

Arguments

text: String to be converted to all lower case

Returns

argument String converted to all lower case

Exceptions

none

Example

allLower(“appName”) returns “appname”

Usage

in code instructions (.xml)

in snippets (.ftl)

${allLower(${object.name})}

metafactory.allLower(modelObject.name)

5.7.1.1.1.2. allUpper

The following table shows the documentation of the allUpper function.

Table 5.53 allUpper

Category

expression language/functions/build-in functions/String functions

Signature

allUpper(String text) : String

Description

Converts all characters in a String to upper case

Arguments

text: String to be converted to all upper case

Returns

argument String converted to all upper case

Exceptions

none

Example

allUpper(“appName”) returns “APPNAME”

Usage

in code instructions (.xml)

in snippets (.ftl)

${allUpper(${object.name})}

metafactory.allUpper(modelObject.name)

5.7.1.1.1.3. camelCaseToTitleFormat

The following table shows the documentation of the camelCaseToTitleFormat function.

Table 5.54 camelCaseToTitleFormat

Category

expression language/functions/build-in functions/String functions

Signature

camelCaseToTitleFormat(String text) : String

Description

convert string from camel case to title format

The first word of the title and subtitle are uppercased, and major words have the first letter of the word capitalized.

Example: Average Number of Donuts

Arguments

text: string in camel case to be converted to title format

Returns

argument string in camel case converted to title format

Exceptions

none

Example

camelCaseToTitleFormat(“appName”) returns “App Name”.

Usage

in code instructions (.xml)

in snippets (.ftl)

${camelCaseToTitleFormat(${object.name})}

metafactory.camelCaseToTitleFormat(modelObject.name)

5.7.1.1.1.4. camelToAllUpperUnderscore

The following table shows the documentation of the camelToAllUpperUnderscore function.

Table 5.55 camelToAllUpperUnderscore

Category

expression language/functions/build-in functions/String functions

Signature

camelToAllUpperUnderscore(String text) : String

Description

convert string from camel case to all upper case with underscores

Example: AVERAGE_NUMBER_OF_DONUTS

Arguments

text: string in camel case to be converted to all upper case with underscores

Returns

argument string in camel case converted to all upper case with underscores

Exceptions

none

Example

camelToAllUpperUnderscore(“firstItem”) returns “FIRST_ITEM”.

Usage

in code instructions (.xml)

in snippets (.ftl)

${camelToAllUpperUnderscore(${object.name})}

metafactory.camelToAllUpperUnderscore(modelObject.name)

5.7.1.1.1.5. camelToKebabCase

The following table shows the documentation of the camelToKebabCase function.

Table 5.56 camelToKebabCase

Category

expression language/functions/build-in functions/String functions

Signature

camelToKebabCase(String text) : String

Description

Converts String from camel case to kebab case.

In kebab case all parts of a name are in lower case and connected by hyphens.

Example: average-number-of-donuts

Arguments

text: String in camel case to be converted to kebab case

Returns

argument string converted to kebab case

Exceptions

none

Example

camelToKebabCase(“appName”) returns “app-name”

Usage

in code instructions (.xml)

in snippets (.ftl)

${camelToKebabCase(${object.name})}

metafactory.camelToKebabCase(modelObject.name)

5.7.1.1.1.6. camelToSnakeCase

The following table shows the documentation of the camelToSnakeCase function.

Table 5.57 camelToSnakeCase

Category

expression language/functions/build-in functions/String functions

Signature

camelToSnakeCase(String text) : String

Description

Converts String from camel case to snake case.

In snake case all parts of a name are in lower case and connected by underscores.

Example: average_number_of_donuts

Arguments

text: string in camel case to be converted to snake case

Returns

argument string in camel case converted to snake case.

Exceptions

none

Example

camelToSnakeCase(“appName”) returns “app_name”

Usage

in code instructions (.xml)

in snippets (.ftl)

${camelToSnakeCase(${object.name})}

metafactory.allLower(modelObject.name)

5.7.1.1.1.7. firstLower

The following table shows the documentation of the firstLower function.

Table 5.58 firstLower

Category

expression language/functions/build-in functions/String functions

Signature

firstLower(String text) : String

Description

Converts the first character of a String to lower case.

Arguments

text : String of which first character needs to be converted to lower case

Returns

argument String with first character converted to lower case

Exceptions

none

Example

firstLower(“AppName”) returns “appName”

Usage

in code instructions (.xml)

in snippets (.ftl)

${firstLower(${object.name})}

metafactory.firstLower(modelObject.name)

5.7.1.1.1.8. firstUpper

The following table shows the documentation of the firstUpper function.

Table 5.59 firstUpper

Category

expression language/functions/build-in functions/String functions

Signature

firstUpper(String text) : String

Description

Converts the first character in a String to upper case..

Arguments

text: String of which first character needs to be converted to upper case

Returns

argument String with first character converted to upper case

Exceptions

none

Example

firstUpper(“appName”) returns “AppName”

Usage

in code instructions (.xml)

in snippets (.ftl)

${firstUpper(${object.name})}

metafactory.firstUpper(modelObject.name)