Use part of a variable in a title

Can you extract part of a variable to use in a title?
When attempting to produce panels for AWS TargetGroups I get the names of the TargetGroups into a variable and use that as the title, but the names are very long.
e.g. targetgroup/int-rp-preprod-pprod-8202/a85cc17d4d87a4409
Is it possible to extract part of the text from a variable.
e.g. int-rp-preprod-pprod-8202