Recently I found the documentation about this subject > FME String Functions
These functions can be used in the Advanced Text Editor for the AttributeCreator etc. In some cases operating strings, using those effectively, we can reduce dramatically the number of transformers on the canvas.
Community > Attribute Trimmer
For example, just one AttributeCreator with the following expression as the value parameter for new attribute completes the job required in the question:
However, I don't know whether it's preferable or not from the viewpoint of maintainability. If using too many functions in a expression, it would become difficult to understand.
Use them moderately.