Trimming a string - 7.1

Talend Big Data Studio User Guide

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

It is easy to use the talendTrim routine, along with a tJava component to remove the string padding characters from the start and end of the string:

System.out.println(TalendString.talendTrim("**talend open studio****",'*', -1));
System.out.println(TalendString.talendTrim("**talend open studio****",'*', 1)); 
System.out.println(TalendString.talendTrim("**talend open studio****",'*',0));

The star characters are removed from the start, then the end of the string and then finally from both ends: