Inside a target, this can be done using the batching syntax for items and using the System.String.Copy method to be able to call instance functions on the string:
Note that this syntax only works inside a target and not during static evaluation (item group directly under the node).