# Replacing an element in a string

It is easy to use the CHANGE routine along with a tJava component, to replace one element in a string with another:

```
System.out.println(StringHandling.CHANGE("hello world!", "world", "guy"));
```

The routine replaces the old element with the new element specified.

![The result is "hello guy!" in the Run view.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/routines6-2.png)