# Trimming a string

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:

![The result is "**talend open studio", then "talend open studio****", and "talend open studio" in the Run view.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/Routines16_b.png)