TalendString Routines - 7.1

Talend Data Management Platform Studio User Guide

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Data Management Platform
task
Design and Development
EnrichPlatform
Talend Studio

The TalendString routines allow you to carry out various operations on alphanumerical expressions.

To access these routines, double-click TalendString under the system folder. The TalendString class contains the following routines:

Routine

Description

Syntax

replaceSpecialCharForXML

returns a string from which the special characters (eg.:: <, >, &...) have been replaced by equivalent XML characters.

TalendString.replaceSpecialCharForXML ("string containing the special characters - eg.: Thelma & Louise")

checkCDATAForXML

identifies characters starting with <![CDATA[ and ending with ]]> as pertaining to XML and returns them without modification. Transforms the strings not identified as XML in a form which is compatible with XML and returns them.

TalendString.checkCDATAForXML("string to be parsed")

talendTrim

parses the entry string and removes the filler characters from the start and end of the string according to the alignment value specified: -1 for the filler characters at the end of the string, 1 for those at the start of the string and 0 for both. Returns the trimmed string.

TalendString.talendTrim("string to be parsed", "filler character to be removed", character position)

removeAccents

removes accents from a string and returns the string without the accents.

TalendString.removeAccents("String")

getAsciiRandomString

generates a random string with a specific number of characters.

TalendString.getAsciiRandomString(whole number indicating the length of the string)