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.](/en-US/studio-user-guide/8.0-R2024-07/Content/Resources/images/routines6-2.png)
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!