Implement a helper class for `to_s` method of user defined objects

I added a helper class which is used in `to_s` method of user defined objects.